From 6264437ff968ec08436bbbe3474e67104d756571 Mon Sep 17 00:00:00 2001 From: Philip Arthur Moore Date: Thu, 14 Nov 2013 19:49:50 +0700 Subject: [PATCH 1/2] Add braces around single-line conditionals. See http://make.wordpress.org/core/2013/11/13/proposed-coding-standards-change-always-require-braces/. --- comments.php | 3 ++- functions.php | 6 ++++-- inc/custom-header.php | 3 ++- inc/extras.php | 12 ++++++++---- inc/template-tags.php | 11 +++++++---- page.php | 3 ++- single.php | 3 ++- 7 files changed, 27 insertions(+), 14 deletions(-) diff --git a/comments.php b/comments.php index fb0195f..786f9e6 100644 --- a/comments.php +++ b/comments.php @@ -15,8 +15,9 @@ * the visitor has not yet entered the password we will * return early without loading the comments. */ -if ( post_password_required() ) +if ( post_password_required() ) { return; +} ?>
diff --git a/functions.php b/functions.php index eb4682d..d63f9f1 100644 --- a/functions.php +++ b/functions.php @@ -8,8 +8,9 @@ /** * Set the content width based on the theme's design and stylesheet. */ -if ( ! isset( $content_width ) ) +if ( ! isset( $content_width ) ) { $content_width = 640; /* pixels */ +} if ( ! function_exists( '_s_setup' ) ) : /** @@ -81,8 +82,9 @@ function _s_scripts() { wp_enqueue_script( '_s-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true ); - if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) + if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); + } } add_action( 'wp_enqueue_scripts', '_s_scripts' ); diff --git a/inc/custom-header.php b/inc/custom-header.php index 57cff74..f91d08b 100644 --- a/inc/custom-header.php +++ b/inc/custom-header.php @@ -49,8 +49,9 @@ function _s_header_style() { // 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 - if ( HEADER_TEXTCOLOR == $header_text_color ) + if ( HEADER_TEXTCOLOR == $header_text_color ) { return; + } // If we get this far, we have custom styles. Let's do this. ?> diff --git a/inc/extras.php b/inc/extras.php index 211e9ee..66b1d72 100644 --- a/inc/extras.php +++ b/inc/extras.php @@ -27,8 +27,9 @@ add_filter( 'wp_page_menu_args', '_s_page_menu_args' ); */ function _s_body_classes( $classes ) { // Adds a class of group-blog to blogs with more than 1 published author. - if ( is_multi_author() ) + if ( is_multi_author() ) { $classes[] = 'group-blog'; + } return $classes; } @@ -44,20 +45,23 @@ add_filter( 'body_class', '_s_body_classes' ); function _s_wp_title( $title, $sep ) { global $page, $paged; - if ( is_feed() ) + if ( is_feed() ) { return $title; + } // Add the blog name $title .= get_bloginfo( 'name' ); // Add the blog description for the home/front page. $site_description = get_bloginfo( 'description', 'display' ); - if ( $site_description && ( is_home() || is_front_page() ) ) + if ( $site_description && ( is_home() || is_front_page() ) ) { $title .= " $sep $site_description"; + } // Add a page number if necessary: - if ( $paged >= 2 || $page >= 2 ) + if ( $paged >= 2 || $page >= 2 ) { $title .= " $sep " . sprintf( __( 'Page %s', '_s' ), max( $paged, $page ) ); + } return $title; } diff --git a/inc/template-tags.php b/inc/template-tags.php index 89eb142..4843de7 100644 --- a/inc/template-tags.php +++ b/inc/template-tags.php @@ -19,13 +19,15 @@ function _s_content_nav( $nav_id ) { $previous = ( is_attachment() ) ? get_post( $post->post_parent ) : get_adjacent_post( false, '', true ); $next = get_adjacent_post( false, '', false ); - if ( ! $next && ! $previous ) + if ( ! $next && ! $previous ) { return; + } } // Don't print empty markup in archives if there's only one page. - if ( $wp_query->max_num_pages < 2 && ( is_home() || is_archive() || is_search() ) ) + if ( $wp_query->max_num_pages < 2 && ( is_home() || is_archive() || is_search() ) ) { return; + } $nav_class = ( is_single() ) ? 'post-navigation' : 'paging-navigation'; @@ -77,7 +79,7 @@ function _s_comment( $comment, $args, $depth ) {