Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Codesniffer errors. #762

Merged
merged 1 commit into from
May 28, 2015
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
4 changes: 3 additions & 1 deletion archive.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
<?php while ( have_posts() ) : the_post(); ?>

<?php
/* Include the Post-Format-specific template for the content.

/*
* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
Expand Down
12 changes: 6 additions & 6 deletions comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@
<?php if ( have_comments() ) : ?>
<h2 class="comments-title">
<?php
printf( // WPCS: XSS OK
printf( // WPCS: XSS OK.
esc_html( _nx( 'One thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', get_comments_number(), 'comments title', '_s' ) ),
number_format_i18n( get_comments_number() ),
'<span>' . get_the_title() . '</span>'
);
?>
</h2>

<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?>
<nav id="comment-nav-above" class="navigation comment-navigation" role="navigation">
<h2 class="screen-reader-text"><?php esc_html_e( 'Comment navigation', '_s' ); ?></h2>
<div class="nav-links">
Expand All @@ -43,7 +43,7 @@

</div><!-- .nav-links -->
</nav><!-- #comment-nav-above -->
<?php endif; // check for comment navigation ?>
<?php endif; // Check for comment navigation. ?>

<ol class="comment-list">
<?php
Expand All @@ -54,7 +54,7 @@
?>
</ol><!-- .comment-list -->

<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?>
<nav id="comment-nav-below" class="navigation comment-navigation" role="navigation">
<h2 class="screen-reader-text"><?php esc_html_e( 'Comment navigation', '_s' ); ?></h2>
<div class="nav-links">
Expand All @@ -64,9 +64,9 @@

</div><!-- .nav-links -->
</nav><!-- #comment-nav-below -->
<?php endif; // check for comment navigation ?>
<?php endif; // Check for comment navigation. ?>

<?php endif; // have_comments() ?>
<?php endif; // Check for have_comments(). ?>

<?php
// If comments are closed and there are comments, let's leave a little note, shall we?
Expand Down
1 change: 1 addition & 0 deletions footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*
* @package _s
*/

?>

</div><!-- #content -->
Expand Down
17 changes: 12 additions & 5 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* as indicating support for post thumbnails.
*/
function _s_setup() {

/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
Expand All @@ -39,7 +38,7 @@ function _s_setup() {
*
* @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
*/
//add_theme_support( 'post-thumbnails' );
add_theme_support( 'post-thumbnails' );
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is totally fine. I'm okay with uncommenting this.


// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
Expand All @@ -51,15 +50,23 @@ function _s_setup() {
* to output valid HTML5.
*/
add_theme_support( 'html5', array(
'search-form', 'comment-form', 'comment-list', 'gallery', 'caption',
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption',
) );

/*
* Enable support for Post Formats.
* See http://codex.wordpress.org/Post_Formats
*/
add_theme_support( 'post-formats', array(
'aside', 'image', 'video', 'quote', 'link',
'aside',
'image',
'video',
'quote',
'link',
) );

// Set up the WordPress core custom background feature.
Expand Down Expand Up @@ -120,7 +127,7 @@ function _s_scripts() {
/**
* Implement the Custom Header feature.
*/
//require get_template_directory() . '/inc/custom-header.php';
require get_template_directory() . '/inc/custom-header.php';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also think that uncommenting this is totally fine as well. It always struck me as weird that _s had commented code for functionality like featured post thumbnails and the custom header. Thanks for handling this.


/**
* Custom template tags for this theme.
Expand Down
1 change: 1 addition & 0 deletions header.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*
* @package _s
*/

?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
Expand Down
9 changes: 4 additions & 5 deletions inc/custom-header.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
* http://codex.wordpress.org/Custom_Headers
*
* You can add an optional custom header image to header.php like so ...

*
<?php if ( get_header_image() ) : ?>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home">
<img src="<?php header_image(); ?>" width="<?php echo esc_attr( get_custom_header()->width ); ?>" height="<?php echo esc_attr( get_custom_header()->height ); ?>" alt="">
</a>
<?php endif; // End header image check. ?>

*
* @package _s
*/
Expand Down Expand Up @@ -46,7 +45,7 @@ function _s_header_style() {
$header_text_color = get_header_textcolor();

// If no custom options for text are set, let's bail
// get_header_textcolor() options: HEADER_TEXTCOLOR is default, hide text (returns 'blank') or any hex value
// get_header_textcolor() options: HEADER_TEXTCOLOR is default, hide text (returns 'blank') or any hex value.
if ( HEADER_TEXTCOLOR == $header_text_color ) {
return;
}
Expand All @@ -64,7 +63,7 @@ function _s_header_style() {
clip: rect(1px, 1px, 1px, 1px);
}
<?php
// If the user has set a custom color for the text use that
// If the user has set a custom color for the text use that.
else :
?>
.site-title a,
Expand Down Expand Up @@ -124,4 +123,4 @@ function _s_admin_header_image() {
</div>
<?php
}
endif; // _s_admin_header_image
endif; // _s_admin_header_image
4 changes: 2 additions & 2 deletions inc/extras.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function _s_wp_title( $title, $sep ) {

global $page, $paged;

// Add the blog name
// Add the blog name.
$title .= get_bloginfo( 'name', 'display' );

// Add the blog description for the home/front page.
Expand All @@ -47,7 +47,7 @@ function _s_wp_title( $title, $sep ) {
$title .= " $sep $site_description";
}

// Add a page number if necessary:
// Add a page number if necessary.
if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) {
$title .= " $sep " . sprintf( esc_html__( 'Page %s', '_s' ), max( $paged, $page ) );
}
Expand Down
5 changes: 4 additions & 1 deletion inc/jetpack.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ function _s_jetpack_setup() {
} // end function _s_jetpack_setup
add_action( 'after_setup_theme', '_s_jetpack_setup' );

/**
* Custom render function for Infinite Scroll.
*/
function _s_infinite_scroll_render() {
while ( have_posts() ) {
the_post();
get_template_part( 'template-parts/content', get_post_format() );
}
} // end function _s_infinite_scroll_render
} // end function _s_infinite_scroll_render
10 changes: 5 additions & 5 deletions inc/template-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function _s_posted_on() {
'<span class="author vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '">' . esc_html( get_the_author() ) . '</a></span>'
);

echo '<span class="posted-on">' . $posted_on . '</span><span class="byline"> ' . $byline . '</span>'; // WPCS: XSS OK
echo '<span class="posted-on">' . $posted_on . '</span><span class="byline"> ' . $byline . '</span>'; // WPCS: XSS OK.

}
endif;
Expand All @@ -107,13 +107,13 @@ function _s_entry_footer() {
/* translators: used between list items, there is a space after the comma */
$categories_list = get_the_category_list( esc_html__( ', ', '_s' ) );
if ( $categories_list && _s_categorized_blog() ) {
printf( '<span class="cat-links">' . esc_html__( 'Posted in %1$s', '_s' ) . '</span>', $categories_list ); // WPCS: XSS OK
printf( '<span class="cat-links">' . esc_html__( 'Posted in %1$s', '_s' ) . '</span>', $categories_list ); // WPCS: XSS OK.
}

/* translators: used between list items, there is a space after the comma */
$tags_list = get_the_tag_list( '', esc_html__( ', ', '_s' ) );
if ( $tags_list ) {
printf( '<span class="tags-links">' . esc_html__( 'Tagged %1$s', '_s' ) . '</span>', $tags_list ); // WPCS: XSS OK
printf( '<span class="tags-links">' . esc_html__( 'Tagged %1$s', '_s' ) . '</span>', $tags_list ); // WPCS: XSS OK.
}
}

Expand Down Expand Up @@ -189,7 +189,7 @@ function the_archive_title( $before = '', $after = '' ) {
$title = apply_filters( 'get_the_archive_title', $title );

if ( ! empty( $title ) ) {
echo $before . $title . $after; // WPCS: XSS OK
echo $before . $title . $after; // WPCS: XSS OK.
}
}
endif;
Expand All @@ -216,7 +216,7 @@ function the_archive_description( $before = '', $after = '' ) {
*
* @param string $description Archive description to be displayed.
*/
echo $before . $description . $after; // WPCS: XSS OK
echo $before . $description . $after; // WPCS: XSS OK.
}
}
endif;
Expand Down
4 changes: 3 additions & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
<?php while ( have_posts() ) : the_post(); ?>

<?php
/* Include the Post-Format-specific template for the content.

/*
* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
Expand Down
4 changes: 2 additions & 2 deletions page.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
<?php get_template_part( 'template-parts/content', 'page' ); ?>

<?php
// If comments are open or we have at least one comment, load up the comment template
// If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
?>

<?php endwhile; // end of the loop. ?>
<?php endwhile; // End of the loop. ?>

</main><!-- #main -->
</div><!-- #primary -->
Expand Down
4 changes: 2 additions & 2 deletions single.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
<?php the_post_navigation(); ?>

<?php
// If comments are open or we have at least one comment, load up the comment template
// If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
?>

<?php endwhile; // end of the loop. ?>
<?php endwhile; // End of the loop. ?>

</main><!-- #main -->
</div><!-- #primary -->
Expand Down
3 changes: 2 additions & 1 deletion template-parts/content-none.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*
* @package _s
*/

?>

<section class="no-results not-found">
Expand All @@ -30,4 +31,4 @@

<?php endif; ?>
</div><!-- .page-content -->
</section><!-- .no-results -->
</section><!-- .no-results -->
2 changes: 2 additions & 0 deletions template-parts/content-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*
* @package _s
*/

?>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
Expand All @@ -25,3 +26,4 @@
<?php edit_post_link( esc_html__( 'Edit', '_s' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-footer -->
</article><!-- #post-## -->

2 changes: 2 additions & 0 deletions template-parts/content-search.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*
* @package _s
*/

?>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
Expand All @@ -27,3 +28,4 @@
<?php _s_entry_footer(); ?>
</footer><!-- .entry-footer -->
</article><!-- #post-## -->

4 changes: 4 additions & 0 deletions template-parts/content-single.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<?php
/**
* Template part for displaying single posts.
*
* @package _s
*/

?>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
Expand All @@ -27,3 +30,4 @@
<?php _s_entry_footer(); ?>
</footer><!-- .entry-footer -->
</article><!-- #post-## -->

5 changes: 4 additions & 1 deletion template-parts/content.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<?php
/**
* Template part for displaying posts.
*
* @package _s
*/

?>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
Expand Down Expand Up @@ -35,4 +38,4 @@
<footer class="entry-footer">
<?php _s_entry_footer(); ?>
</footer><!-- .entry-footer -->
</article><!-- #post-## -->
</article><!-- #post-## -->