Skip to content
This repository has been archived by the owner on Sep 16, 2019. It is now read-only.

Fix Travis CI Build Errors #956

Merged
merged 3 commits into from
Mar 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion 404.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,15 @@
<p><?php _e( 'Please try the following:', 'foundationpress' ); ?></p>
<ul>
<li><?php _e( 'Check your spelling', 'foundationpress' ); ?></li>
<li><?php printf( __( 'Return to the <a href="%s">home page</a>', 'foundationpress' ), home_url() ); ?></li>
<li>
<?php
/* translators: %s: home page url */
printf( __(
'Return to the <a href="%s">home page</a>', 'foundationpress' ),
home_url()
);
?>
</li>
<li><?php _e( 'Click the <a href="javascript:history.back()">Back</a> button', 'foundationpress' ); ?></li>
</ul>
</div>
Expand Down
33 changes: 29 additions & 4 deletions comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
Prevent access to this file directly
*/

defined( 'ABSPATH' ) or die( __( 'Please do not load this page directly. Thanks!', 'foundationpress' ) );
defined( 'ABSPATH' ) || die( __( 'Please do not load this page directly. Thanks!', 'foundationpress' ) );

if ( post_password_required() ) { ?>
<section id="comments">
Expand All @@ -69,14 +69,39 @@
if ( (is_page() || is_single()) && ( ! is_home() && ! is_front_page()) ) :
?>
<section id="respond">
<h3><?php comment_form_title( __( 'Leave a Reply', 'foundationpress' ), __( 'Leave a Reply to %s', 'foundationpress' ) ); ?></h3>
<h3>
<?php
comment_form_title(
__( 'Leave a Reply', 'foundationpress' ),
/* translators: %s: author of comment being replied to */
__( 'Leave a Reply to %s', 'foundationpress' )
);
?>
</h3>
<p class="cancel-comment-reply"><?php cancel_comment_reply_link(); ?></p>
<?php if ( get_option( 'comment_registration' ) && ! is_user_logged_in() ) : ?>
<p><?php printf( __( 'You must be <a href="%s">logged in</a> to post a comment.', 'foundationpress' ), wp_login_url( get_permalink() ) ); ?></p>
<p>
<?php
/* translators: %s: login url */
printf( __(
'You must be <a href="%s">logged in</a> to post a comment.', 'foundationpress' ),
wp_login_url( get_permalink() )
);
?>
</p>
<?php else : ?>
<form action="<?php echo get_option( 'siteurl' ); ?>/wp-comments-post.php" method="post" id="commentform">
<?php if ( is_user_logged_in() ) : ?>
<p><?php printf( __( 'Logged in as <a href="%1$s/wp-admin/profile.php">%2$s</a>.', 'foundationpress' ), get_option( 'siteurl' ), $user_identity ); ?> <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="<?php __( 'Log out of this account', 'foundationpress' ); ?>"><?php _e( 'Log out &raquo;', 'foundationpress' ); ?></a></p>
<p>
<?php
/* translators: %1$s: site url, %2$s: user identity */
printf( __(
'Logged in as <a href="%1$s/wp-admin/profile.php">%2$s</a>.', 'foundationpress' ),
get_option( 'siteurl' ),
$user_identity
);
?> <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="<?php __( 'Log out of this account', 'foundationpress' ); ?>"><?php _e( 'Log out &raquo;', 'foundationpress' ); ?></a>
</p>
<?php else : ?>
<p>
<label for="author">
Expand Down
8 changes: 6 additions & 2 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,15 @@
/** Required for Foundation to work properly */
require_once( 'library/foundation.php' );

/** Format comments */
require_once( 'library/class-foundationpress-comments.php' );

/** Register all navigation menus */
require_once( 'library/navigation.php' );

/** Add menu walkers for top-bar and off-canvas */
require_once( 'library/menu-walkers.php' );
require_once( 'library/class-foundationpress-top-bar-walker.php' );
require_once( 'library/class-foundationpress-mobile-walker.php' );

/** Create widget areas in sidebar and footer */
require_once( 'library/widget-areas.php' );
Expand All @@ -48,4 +52,4 @@
require_once( 'library/responsive-images.php' );

/** If your site requires protocol relative url's for theme assets, uncomment the line below */
// require_once( 'library/protocol-relative-theme-assets.php' );
// require_once( 'library/class-foundationpress-protocol-relative-theme-assets.php' );
116 changes: 116 additions & 0 deletions library/class-foundationpress-comments.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
<?php
/**
* FoundationPress Comments
*
* @package FoundationPress
*/

if ( ! class_exists( 'Foundationpress_Comments' ) ) :
class Foundationpress_Comments extends Walker_Comment {

// Init classwide variables.
public $tree_type = 'comment';

// Comment ID
public $db_fields = array(
'parent' => 'comment_parent',
'id' => 'comment_ID',
);

/** CONSTRUCTOR
* You'll have to use this if you plan to get to the top of the comments list, as
* start_lvl() only goes as high as 1 deep nested comments */
function __construct() { ?>

<h3><?php comments_number( __( 'No Responses to', 'foundationpress' ), __( 'One Response to', 'foundationpress' ), __( '% Responses to', 'foundationpress' ) ); ?> &#8220;<?php the_title(); ?>&#8221;</h3>
<ol class="comment-list">

<?php }

/** START_LVL
* Starts the list before the CHILD elements are added. */
function start_lvl( &$output, $depth = 0, $args = array() ) {
$GLOBALS['comment_depth'] = $depth + 1; ?>

<ul class="children">
<?php }

/** END_LVL
* Ends the children list of after the elements are added. */
function end_lvl( &$output, $depth = 0, $args = array() ) {
$GLOBALS['comment_depth'] = $depth + 1; ?>

</ul><!-- /.children -->

<?php }

/** START_EL */
function start_el( &$output, $comment, $depth = 0, $args = array(), $id = 0 ) {
$depth++;
$GLOBALS['comment_depth'] = $depth;
$GLOBALS['comment'] = $comment;
$parent_class = ( empty( $args['has_children'] ) ? '' : 'parent' ); ?>

<li <?php comment_class( $parent_class ); ?> id="comment-<?php comment_ID() ?>">
<article id="comment-body-<?php comment_ID() ?>" class="comment-body">



<header class="comment-author">

<?php echo get_avatar( $comment, $args['avatar_size'] ); ?>

<div class="author-meta vcard author">

<?php
/* translators: %s: comment author link */
printf( __(
'<cite class="fn">%s</cite>', 'foundationpress' ),
get_comment_author_link()
);
?>
<time datetime="<?php echo comment_date( 'c' ) ?>"><a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ) ?>"><?php printf( get_comment_date(), get_comment_time() ) ?></a></time>

</div><!-- /.comment-author -->

</header>

<section id="comment-content-<?php comment_ID(); ?>" class="comment">
<?php if ( ! $comment->comment_approved ) : ?>
<div class="notice">
<p class="bottom"><?php _e( 'Your comment is awaiting moderation.' ); ?></p>
</div>
<?php else : comment_text(); ?>
<?php endif; ?>
</section><!-- /.comment-content -->

<div class="comment-meta comment-meta-data hide">
<a href="<?php echo htmlspecialchars( get_comment_link( get_comment_ID() ) ) ?>"><?php comment_date(); ?> at <?php comment_time(); ?></a> <?php edit_comment_link( '(Edit)' ); ?>
</div><!-- /.comment-meta -->

<div class="reply">
<?php $reply_args = array(
'depth' => $depth,
'max_depth' => $args['max_depth'],
);

comment_reply_link( array_merge( $args, $reply_args ) ); ?>
</div><!-- /.reply -->
</article><!-- /.comment-body -->

<?php }

function end_el(& $output, $comment, $depth = 0, $args = array() ) { ?>

</li><!-- /#comment-' . get_comment_ID() . ' -->

<?php }

/** DESTRUCTOR */
function __destruct() { ?>

</ol><!-- /#comment-list -->

<?php }
}
endif;
20 changes: 20 additions & 0 deletions library/class-foundationpress-mobile-walker.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php
/**
* Customize the output of menus for Foundation mobile walker
*
* @package FoundationPress
* @since FoundationPress 1.0.0
*/

/**
* Big thanks to Brett Mason (https://github.com/brettsmason) for the awesome walker
*/

if ( ! class_exists( 'Foundationpress_Mobile_Walker' ) ) :
class Foundationpress_Mobile_Walker extends Walker_Nav_Menu {
function start_lvl( &$output, $depth = 0, $args = array() ) {
$indent = str_repeat("\t", $depth);
$output .= "\n$indent<ul class=\"vertical nested menu\">\n";
}
}
endif;
20 changes: 20 additions & 0 deletions library/class-foundationpress-top-bar-walker.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php
/**
* Customize the output of menus for Foundation top bar
*
* @package FoundationPress
* @since FoundationPress 1.0.0
*/

/**
* Big thanks to Brett Mason (https://github.com/brettsmason) for the awesome walker
*/

if ( ! class_exists( 'Foundationpress_Top_Bar_Walker' ) ) :
class Foundationpress_Top_Bar_Walker extends Walker_Nav_Menu {
function start_lvl( &$output, $depth = 0, $args = array() ) {
$indent = str_repeat("\t", $depth);
$output .= "\n$indent<ul class=\"dropdown menu vertical\" data-toggle>\n";
}
}
endif;
1 change: 1 addition & 0 deletions library/entry-meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

if ( ! function_exists( 'foundationpress_entry_meta' ) ) :
function foundationpress_entry_meta() {
/* translators: %1$s: current date, %2$s: current time */
echo '<time class="updated" datetime="' . get_the_time( 'c' ) . '">' . sprintf( __( 'Posted on %1$s at %2$s.', 'foundationpress' ), get_the_date(), get_the_time() ) . '</time>';
echo '<p class="byline author">' . __( 'Written by', 'foundationpress' ) . ' <a href="' . get_author_posts_url( get_the_author_meta( 'ID' ) ) . '" rel="author" class="fn">' . get_the_author() . '</a></p>';
}
Expand Down
122 changes: 12 additions & 110 deletions library/foundation.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,18 @@ function foundationpress_pagination() {
if ( ! function_exists( 'foundationpress_menu_fallback' ) ) :
function foundationpress_menu_fallback() {
echo '<div class="alert-box secondary">';
// Translators 1: Link to Menus, 2: Link to Customize.
printf( __( 'Please assign a menu to the primary menu location under %1$s or %2$s the design.', 'foundationpress' ),
sprintf( __( '<a href="%s">Menus</a>', 'foundationpress' ),
get_admin_url( get_current_blog_id(), 'nav-menus.php' )
),
sprintf( __( '<a href="%s">Customize</a>', 'foundationpress' ),
get_admin_url( get_current_blog_id(), 'customize.php' )
)
);
echo '</div>';
/* translators: %1$s: link to menus, %2$s: link to customize. */
printf( __( 'Please assign a menu to the primary menu location under %1$s or %2$s the design.', 'foundationpress' ),
/* translators: %s: menu url */
sprintf( __( '<a href="%s">Menus</a>', 'foundationpress' ),
get_admin_url( get_current_blog_id(), 'nav-menus.php' )
),
/* translators: %s: customize url */
sprintf( __( '<a href="%s">Customize</a>', 'foundationpress' ),
get_admin_url( get_current_blog_id(), 'customize.php' )
)
);
echo '</div>';
}
endif;

Expand Down Expand Up @@ -90,103 +92,3 @@ function foundationpress_active_list_pages_class( $input ) {
add_filter( 'wp_list_pages', 'foundationpress_active_list_pages_class', 10, 2 );
endif;

if ( ! class_exists( 'Foundationpress_Comments' ) ) :
class Foundationpress_Comments extends Walker_Comment {

// Init classwide variables.
var $tree_type = 'comment';

// Comment ID
var $db_fields = array( 'parent' => 'comment_parent', 'id' => 'comment_ID' );

/** CONSTRUCTOR
* You'll have to use this if you plan to get to the top of the comments list, as
* start_lvl() only goes as high as 1 deep nested comments */
function __construct() { ?>

<h3><?php comments_number( __( 'No Responses to', 'foundationpress' ), __( 'One Response to', 'foundationpress' ), __( '% Responses to', 'foundationpress' ) ); ?> &#8220;<?php the_title(); ?>&#8221;</h3>
<ol class="comment-list">

<?php }

/** START_LVL
* Starts the list before the CHILD elements are added. */
function start_lvl( &$output, $depth = 0, $args = array() ) {
$GLOBALS['comment_depth'] = $depth + 1; ?>

<ul class="children">
<?php }

/** END_LVL
* Ends the children list of after the elements are added. */
function end_lvl( &$output, $depth = 0, $args = array() ) {
$GLOBALS['comment_depth'] = $depth + 1; ?>

</ul><!-- /.children -->

<?php }

/** START_EL */
function start_el( &$output, $comment, $depth = 0, $args = array(), $id = 0 ) {
$depth++;
$GLOBALS['comment_depth'] = $depth;
$GLOBALS['comment'] = $comment;
$parent_class = ( empty( $args['has_children'] ) ? '' : 'parent' ); ?>

<li <?php comment_class( $parent_class ); ?> id="comment-<?php comment_ID() ?>">
<article id="comment-body-<?php comment_ID() ?>" class="comment-body">



<header class="comment-author">

<?php echo get_avatar( $comment, $args['avatar_size'] ); ?>

<div class="author-meta vcard author">

<?php printf( __( '<cite class="fn">%s</cite>', 'foundationpress' ), get_comment_author_link() ) ?>
<time datetime="<?php echo comment_date( 'c' ) ?>"><a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ) ?>"><?php printf( get_comment_date(), get_comment_time() ) ?></a></time>

</div><!-- /.comment-author -->

</header>

<section id="comment-content-<?php comment_ID(); ?>" class="comment">
<?php if ( ! $comment->comment_approved ) : ?>
<div class="notice">
<p class="bottom"><?php _e( 'Your comment is awaiting moderation.' ); ?></p>
</div>
<?php else : comment_text(); ?>
<?php endif; ?>
</section><!-- /.comment-content -->

<div class="comment-meta comment-meta-data hide">
<a href="<?php echo htmlspecialchars( get_comment_link( get_comment_ID() ) ) ?>"><?php comment_date(); ?> at <?php comment_time(); ?></a> <?php edit_comment_link( '(Edit)' ); ?>
</div><!-- /.comment-meta -->

<div class="reply">
<?php $reply_args = array(
'depth' => $depth,
'max_depth' => $args['max_depth'],
);

comment_reply_link( array_merge( $args, $reply_args ) ); ?>
</div><!-- /.reply -->
</article><!-- /.comment-body -->

<?php }

function end_el(& $output, $comment, $depth = 0, $args = array() ) { ?>

</li><!-- /#comment-' . get_comment_ID() . ' -->

<?php }

/** DESTRUCTOR */
function __destruct() { ?>

</ol><!-- /#comment-list -->

<?php }
}
endif;
Loading