Completed
Push — master ( d99bf9...491baf )
by Stephen
13:47
created
src/wp-content/themes/twentyseventeen/comments.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
  * the visitor has not yet entered the password we will
19 19
  * return early without loading the comments.
20 20
  */
21
-if ( post_password_required() ) {
21
+if (post_password_required()) {
22 22
 	return;
23 23
 }
24 24
 ?>
@@ -27,13 +27,13 @@  discard block
 block discarded – undo
27 27
 
28 28
 	<?php
29 29
 	// You can start editing here -- including this comment!
30
-	if ( have_comments() ) : ?>
30
+	if (have_comments()) : ?>
31 31
 		<h2 class="comments-title">
32 32
 			<?php
33 33
 			$comments_number = get_comments_number();
34
-			if ( '1' === $comments_number ) {
34
+			if ('1' === $comments_number) {
35 35
 				/* translators: %s: post title */
36
-				printf( _x( 'One Reply to &ldquo;%s&rdquo;', 'comments title', 'twentyseventeen' ), get_the_title() );
36
+				printf(_x('One Reply to &ldquo;%s&rdquo;', 'comments title', 'twentyseventeen'), get_the_title());
37 37
 			} else {
38 38
 				printf(
39 39
 					/* translators: 1: number of comments, 2: post title */
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 						'comments title',
45 45
 						'twentyseventeen'
46 46
 					),
47
-					number_format_i18n( $comments_number ),
47
+					number_format_i18n($comments_number),
48 48
 					get_the_title()
49 49
 				);
50 50
 			}
@@ -53,26 +53,26 @@  discard block
 block discarded – undo
53 53
 
54 54
 		<ol class="comment-list">
55 55
 			<?php
56
-				wp_list_comments( array(
56
+				wp_list_comments(array(
57 57
 					'avatar_size' => 100,
58 58
 					'style'       => 'ol',
59 59
 					'short_ping'  => true,
60
-					'reply_text'  => twentyseventeen_get_svg( array( 'icon' => 'mail-reply' ) ) . __( 'Reply', 'twentyseventeen' ),
61
-				) );
60
+					'reply_text'  => twentyseventeen_get_svg(array('icon' => 'mail-reply')).__('Reply', 'twentyseventeen'),
61
+				));
62 62
 			?>
63 63
 		</ol>
64 64
 
65
-		<?php the_comments_pagination( array(
66
-			'prev_text' => twentyseventeen_get_svg( array( 'icon' => 'arrow-left' ) ) . '<span class="screen-reader-text">' . __( 'Previous', 'twentyseventeen' ) . '</span>',
67
-			'next_text' => '<span class="screen-reader-text">' . __( 'Next', 'twentyseventeen' ) . '</span>' . twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ),
68
-		) );
65
+		<?php the_comments_pagination(array(
66
+			'prev_text' => twentyseventeen_get_svg(array('icon' => 'arrow-left')).'<span class="screen-reader-text">'.__('Previous', 'twentyseventeen').'</span>',
67
+			'next_text' => '<span class="screen-reader-text">'.__('Next', 'twentyseventeen').'</span>'.twentyseventeen_get_svg(array('icon' => 'arrow-right')),
68
+		));
69 69
 
70 70
 	endif; // Check for have_comments().
71 71
 
72 72
 	// If comments are closed and there are comments, let's leave a little note, shall we?
73
-	if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : ?>
73
+	if ( ! comments_open() && get_comments_number() && post_type_supports(get_post_type(), 'comments')) : ?>
74 74
 
75
-		<p class="no-comments"><?php _e( 'Comments are closed.', 'twentyseventeen' ); ?></p>
75
+		<p class="no-comments"><?php _e('Comments are closed.', 'twentyseventeen'); ?></p>
76 76
 	<?php
77 77
 	endif;
78 78
 
Please login to merge, or discard this patch.
src/wp-content/themes/twentyseventeen/index.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -18,13 +18,13 @@  discard block
 block discarded – undo
18 18
 get_header(); ?>
19 19
 
20 20
 <div class="wrap">
21
-	<?php if ( is_home() && ! is_front_page() ) : ?>
21
+	<?php if (is_home() && ! is_front_page()) : ?>
22 22
 		<header class="page-header">
23 23
 			<h1 class="page-title"><?php single_post_title(); ?></h1>
24 24
 		</header>
25 25
 	<?php else : ?>
26 26
 	<header class="page-header">
27
-		<h2 class="page-title"><?php _e( 'Posts', 'twentyseventeen' ); ?></h2>
27
+		<h2 class="page-title"><?php _e('Posts', 'twentyseventeen'); ?></h2>
28 28
 	</header>
29 29
 	<?php endif; ?>
30 30
 
@@ -32,29 +32,29 @@  discard block
 block discarded – undo
32 32
 		<main id="main" class="site-main" role="main">
33 33
 
34 34
 			<?php
35
-			if ( have_posts() ) :
35
+			if (have_posts()) :
36 36
 
37 37
 				/* Start the Loop */
38
-				while ( have_posts() ) : the_post();
38
+				while (have_posts()) : the_post();
39 39
 
40 40
 					/*
41 41
 					 * Include the Post-Format-specific template for the content.
42 42
 					 * If you want to override this in a child theme, then include a file
43 43
 					 * called content-___.php (where ___ is the Post Format name) and that will be used instead.
44 44
 					 */
45
-					get_template_part( 'template-parts/post/content', get_post_format() );
45
+					get_template_part('template-parts/post/content', get_post_format());
46 46
 
47 47
 				endwhile;
48 48
 
49
-				the_posts_pagination( array(
50
-					'prev_text' => twentyseventeen_get_svg( array( 'icon' => 'arrow-left' ) ) . '<span class="screen-reader-text">' . __( 'Previous page', 'twentyseventeen' ) . '</span>',
51
-					'next_text' => '<span class="screen-reader-text">' . __( 'Next page', 'twentyseventeen' ) . '</span>' . twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ),
52
-					'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentyseventeen' ) . ' </span>',
53
-				) );
49
+				the_posts_pagination(array(
50
+					'prev_text' => twentyseventeen_get_svg(array('icon' => 'arrow-left')).'<span class="screen-reader-text">'.__('Previous page', 'twentyseventeen').'</span>',
51
+					'next_text' => '<span class="screen-reader-text">'.__('Next page', 'twentyseventeen').'</span>'.twentyseventeen_get_svg(array('icon' => 'arrow-right')),
52
+					'before_page_number' => '<span class="meta-nav screen-reader-text">'.__('Page', 'twentyseventeen').' </span>',
53
+				));
54 54
 
55 55
 			else :
56 56
 
57
-				get_template_part( 'template-parts/post/content', 'none' );
57
+				get_template_part('template-parts/post/content', 'none');
58 58
 
59 59
 			endif;
60 60
 			?>
Please login to merge, or discard this patch.
Braces   +8 added lines, -3 removed lines patch added patch discarded remove patch
@@ -22,9 +22,12 @@  discard block
 block discarded – undo
22 22
 		<header class="page-header">
23 23
 			<h1 class="page-title"><?php single_post_title(); ?></h1>
24 24
 		</header>
25
-	<?php else : ?>
25
+	<?php else {
26
+	: ?>
26 27
 	<header class="page-header">
27
-		<h2 class="page-title"><?php _e( 'Posts', 'twentyseventeen' ); ?></h2>
28
+		<h2 class="page-title"><?php _e( 'Posts', 'twentyseventeen' );
29
+}
30
+?></h2>
28 31
 	</header>
29 32
 	<?php endif; ?>
30 33
 
@@ -52,9 +55,11 @@  discard block
 block discarded – undo
52 55
 					'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentyseventeen' ) . ' </span>',
53 56
 				) );
54 57
 
55
-			else :
58
+			else {
59
+				:
56 60
 
57 61
 				get_template_part( 'template-parts/post/content', 'none' );
62
+			}
58 63
 
59 64
 			endif;
60 65
 			?>
Please login to merge, or discard this patch.
src/wp-content/themes/twentyseventeen/404.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,10 +18,10 @@
 block discarded – undo
18 18
 
19 19
 			<section class="error-404 not-found">
20 20
 				<header class="page-header">
21
-					<h1 class="page-title"><?php _e( 'Oops! That page can&rsquo;t be found.', 'twentyseventeen' ); ?></h1>
21
+					<h1 class="page-title"><?php _e('Oops! That page can&rsquo;t be found.', 'twentyseventeen'); ?></h1>
22 22
 				</header><!-- .page-header -->
23 23
 				<div class="page-content">
24
-					<p><?php _e( 'It looks like nothing was found at this location. Maybe try a search?', 'twentyseventeen' ); ?></p>
24
+					<p><?php _e('It looks like nothing was found at this location. Maybe try a search?', 'twentyseventeen'); ?></p>
25 25
 
26 26
 					<?php get_search_form(); ?>
27 27
 
Please login to merge, or discard this patch.
src/wp-content/themes/twentyseventeen/searchform.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -10,12 +10,12 @@
 block discarded – undo
10 10
 
11 11
 ?>
12 12
 
13
-<?php $unique_id = esc_attr( uniqid( 'search-form-' ) ); ?>
13
+<?php $unique_id = esc_attr(uniqid('search-form-')); ?>
14 14
 
15
-<form role="search" method="get" class="search-form" action="<?php echo esc_url( home_url( '/' ) ); ?>">
15
+<form role="search" method="get" class="search-form" action="<?php echo esc_url(home_url('/')); ?>">
16 16
 	<label for="<?php echo $unique_id; ?>">
17
-		<span class="screen-reader-text"><?php echo _x( 'Search for:', 'label', 'twentyseventeen' ); ?></span>
17
+		<span class="screen-reader-text"><?php echo _x('Search for:', 'label', 'twentyseventeen'); ?></span>
18 18
 	</label>
19
-	<input type="search" id="<?php echo $unique_id; ?>" class="search-field" placeholder="<?php echo esc_attr_x( 'Search &hellip;', 'placeholder', 'twentyseventeen' ); ?>" value="<?php echo get_search_query(); ?>" name="s" />
20
-	<button type="submit" class="search-submit"><?php echo twentyseventeen_get_svg( array( 'icon' => 'search' ) ); ?><span class="screen-reader-text"><?php echo _x( 'Search', 'submit button', 'twentyseventeen' ); ?></span></button>
19
+	<input type="search" id="<?php echo $unique_id; ?>" class="search-field" placeholder="<?php echo esc_attr_x('Search &hellip;', 'placeholder', 'twentyseventeen'); ?>" value="<?php echo get_search_query(); ?>" name="s" />
20
+	<button type="submit" class="search-submit"><?php echo twentyseventeen_get_svg(array('icon' => 'search')); ?><span class="screen-reader-text"><?php echo _x('Search', 'submit button', 'twentyseventeen'); ?></span></button>
21 21
 </form>
Please login to merge, or discard this patch.
src/wp-content/themes/twentyseventeen/front-page.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,8 +22,10 @@
 block discarded – undo
22 22
 			while ( have_posts() ) : the_post();
23 23
 				get_template_part( 'template-parts/page/content', 'front-page' );
24 24
 			endwhile;
25
-		else : // I'm not sure it's possible to have no posts when this page is shown, but WTH.
25
+		else {
26
+			: // I'm not sure it's possible to have no posts when this page is shown, but WTH.
26 27
 			get_template_part( 'template-parts/post/content', 'none' );
28
+		}
27 29
 		endif; ?>
28 30
 
29 31
 		<?php
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -18,17 +18,17 @@  discard block
 block discarded – undo
18 18
 	<main id="main" class="site-main" role="main">
19 19
 
20 20
 		<?php // Show the selected frontpage content.
21
-		if ( have_posts() ) :
22
-			while ( have_posts() ) : the_post();
23
-				get_template_part( 'template-parts/page/content', 'front-page' );
21
+		if (have_posts()) :
22
+			while (have_posts()) : the_post();
23
+				get_template_part('template-parts/page/content', 'front-page');
24 24
 			endwhile;
25 25
 		else : // I'm not sure it's possible to have no posts when this page is shown, but WTH.
26
-			get_template_part( 'template-parts/post/content', 'none' );
26
+			get_template_part('template-parts/post/content', 'none');
27 27
 		endif; ?>
28 28
 
29 29
 		<?php
30 30
 		// Get each of our panels and show the post data.
31
-		if ( 0 !== twentyseventeen_panel_count() || is_customize_preview() ) : // If we have pages to show.
31
+		if (0 !== twentyseventeen_panel_count() || is_customize_preview()) : // If we have pages to show.
32 32
 
33 33
 			/**
34 34
 			 * Filter number of front page sections in Twenty Seventeen.
@@ -37,13 +37,13 @@  discard block
 block discarded – undo
37 37
 			 *
38 38
 			 * @param int $num_sections Number of front page sections.
39 39
 			 */
40
-			$num_sections = apply_filters( 'twentyseventeen_front_page_sections', 4 );
40
+			$num_sections = apply_filters('twentyseventeen_front_page_sections', 4);
41 41
 			global $twentyseventeencounter;
42 42
 
43 43
 			// Create a setting and control for each of the sections available in the theme.
44
-			for ( $i = 1; $i < ( 1 + $num_sections ); $i++ ) {
44
+			for ($i = 1; $i < (1 + $num_sections); $i++) {
45 45
 				$twentyseventeencounter = $i;
46
-				twentyseventeen_front_page_section( null, $i );
46
+				twentyseventeen_front_page_section(null, $i);
47 47
 			}
48 48
 
49 49
 	endif; // The if ( 0 !== twentyseventeen_panel_count() ) ends here. ?>
Please login to merge, or discard this patch.
src/wp-content/themes/twentyseventeen/header.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 ?><!DOCTYPE html>
16 16
 <html <?php language_attributes(); ?> class="no-js no-svg">
17 17
 <head>
18
-<meta charset="<?php bloginfo( 'charset' ); ?>">
18
+<meta charset="<?php bloginfo('charset'); ?>">
19 19
 <meta name="viewport" content="width=device-width, initial-scale=1">
20 20
 <link rel="profile" href="http://gmpg.org/xfn/11">
21 21
 
@@ -24,16 +24,16 @@  discard block
 block discarded – undo
24 24
 
25 25
 <body <?php body_class(); ?>>
26 26
 <div id="page" class="site">
27
-	<a class="skip-link screen-reader-text" href="#content"><?php _e( 'Skip to content', 'twentyseventeen' ); ?></a>
27
+	<a class="skip-link screen-reader-text" href="#content"><?php _e('Skip to content', 'twentyseventeen'); ?></a>
28 28
 
29 29
 	<header id="masthead" class="site-header" role="banner">
30 30
 
31
-		<?php get_template_part( 'template-parts/header/header', 'image' ); ?>
31
+		<?php get_template_part('template-parts/header/header', 'image'); ?>
32 32
 
33
-		<?php if ( has_nav_menu( 'top' ) ) : ?>
33
+		<?php if (has_nav_menu('top')) : ?>
34 34
 			<div class="navigation-top">
35 35
 				<div class="wrap">
36
-					<?php get_template_part( 'template-parts/navigation/navigation', 'top' ); ?>
36
+					<?php get_template_part('template-parts/navigation/navigation', 'top'); ?>
37 37
 				</div><!-- .wrap -->
38 38
 			</div><!-- .navigation-top -->
39 39
 		<?php endif; ?>
@@ -46,9 +46,9 @@  discard block
 block discarded – undo
46 46
 	 * If a regular post or page, and not the front page, show the featured image.
47 47
 	 * Using get_queried_object_id() here since the $post global may not be set before a call to the_post().
48 48
 	 */
49
-	if ( ( is_single() || ( is_page() && ! twentyseventeen_is_frontpage() ) ) && has_post_thumbnail( get_queried_object_id() ) ) :
49
+	if ((is_single() || (is_page() && ! twentyseventeen_is_frontpage())) && has_post_thumbnail(get_queried_object_id())) :
50 50
 		echo '<div class="single-featured-image-header">';
51
-		echo get_the_post_thumbnail( get_queried_object_id(), 'twentyseventeen-featured-image' );
51
+		echo get_the_post_thumbnail(get_queried_object_id(), 'twentyseventeen-featured-image');
52 52
 		echo '</div><!-- .single-featured-image-header -->';
53 53
 	endif;
54 54
 	?>
Please login to merge, or discard this patch.
src/wp-content/themes/twentyfourteen/inc/customizer.php 1 patch
Spacing   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -14,68 +14,68 @@  discard block
 block discarded – undo
14 14
  *
15 15
  * @param WP_Customize_Manager $wp_customize Customizer object.
16 16
  */
17
-function twentyfourteen_customize_register( $wp_customize ) {
17
+function twentyfourteen_customize_register($wp_customize) {
18 18
 	// Add postMessage support for site title and description.
19
-	$wp_customize->get_setting( 'blogname' )->transport          = 'postMessage';
20
-	$wp_customize->get_setting( 'blogdescription' )->transport   = 'postMessage';
21
-	$wp_customize->get_setting( 'header_textcolor' )->transport  = 'postMessage';
19
+	$wp_customize->get_setting('blogname')->transport          = 'postMessage';
20
+	$wp_customize->get_setting('blogdescription')->transport   = 'postMessage';
21
+	$wp_customize->get_setting('header_textcolor')->transport  = 'postMessage';
22 22
 
23
-	if ( isset( $wp_customize->selective_refresh ) ) {
24
-		$wp_customize->selective_refresh->add_partial( 'blogname', array(
23
+	if (isset($wp_customize->selective_refresh)) {
24
+		$wp_customize->selective_refresh->add_partial('blogname', array(
25 25
 			'selector' => '.site-title a',
26 26
 			'container_inclusive' => false,
27 27
 			'render_callback' => 'twentyfourteen_customize_partial_blogname',
28
-		) );
29
-		$wp_customize->selective_refresh->add_partial( 'blogdescription', array(
28
+		));
29
+		$wp_customize->selective_refresh->add_partial('blogdescription', array(
30 30
 			'selector' => '.site-description',
31 31
 			'container_inclusive' => false,
32 32
 			'render_callback' => 'twentyfourteen_customize_partial_blogdescription',
33
-		) );
33
+		));
34 34
 	}
35 35
 
36 36
 	// Rename the label to "Site Title Color" because this only affects the site title in this theme.
37
-	$wp_customize->get_control( 'header_textcolor' )->label = __( 'Site Title Color', 'twentyfourteen' );
37
+	$wp_customize->get_control('header_textcolor')->label = __('Site Title Color', 'twentyfourteen');
38 38
 
39 39
 	// Rename the label to "Display Site Title & Tagline" in order to make this option extra clear.
40
-	$wp_customize->get_control( 'display_header_text' )->label = __( 'Display Site Title &amp; Tagline', 'twentyfourteen' );
40
+	$wp_customize->get_control('display_header_text')->label = __('Display Site Title &amp; Tagline', 'twentyfourteen');
41 41
 
42 42
 	// Add custom description to Colors and Background controls or sections.
43
-	if ( property_exists( $wp_customize->get_control( 'background_color' ), 'description' ) ) {
44
-		$wp_customize->get_control( 'background_color' )->description = __( 'May only be visible on wide screens.', 'twentyfourteen' );
45
-		$wp_customize->get_control( 'background_image' )->description = __( 'May only be visible on wide screens.', 'twentyfourteen' );
43
+	if (property_exists($wp_customize->get_control('background_color'), 'description')) {
44
+		$wp_customize->get_control('background_color')->description = __('May only be visible on wide screens.', 'twentyfourteen');
45
+		$wp_customize->get_control('background_image')->description = __('May only be visible on wide screens.', 'twentyfourteen');
46 46
 	} else {
47
-		$wp_customize->get_section( 'colors' )->description           = __( 'Background may only be visible on wide screens.', 'twentyfourteen' );
48
-		$wp_customize->get_section( 'background_image' )->description = __( 'Background may only be visible on wide screens.', 'twentyfourteen' );
47
+		$wp_customize->get_section('colors')->description           = __('Background may only be visible on wide screens.', 'twentyfourteen');
48
+		$wp_customize->get_section('background_image')->description = __('Background may only be visible on wide screens.', 'twentyfourteen');
49 49
 	}
50 50
 
51 51
 	// Add the featured content section in case it's not already there.
52
-	$wp_customize->add_section( 'featured_content', array(
53
-		'title'           => __( 'Featured Content', 'twentyfourteen' ),
54
-		'description'     => sprintf( __( 'Use a <a href="%1$s">tag</a> to feature your posts. If no posts match the tag, <a href="%2$s">sticky posts</a> will be displayed instead.', 'twentyfourteen' ),
55
-			esc_url( add_query_arg( 'tag', _x( 'featured', 'featured content default tag slug', 'twentyfourteen' ), admin_url( 'edit.php' ) ) ),
56
-			admin_url( 'edit.php?show_sticky=1' )
52
+	$wp_customize->add_section('featured_content', array(
53
+		'title'           => __('Featured Content', 'twentyfourteen'),
54
+		'description'     => sprintf(__('Use a <a href="%1$s">tag</a> to feature your posts. If no posts match the tag, <a href="%2$s">sticky posts</a> will be displayed instead.', 'twentyfourteen'),
55
+			esc_url(add_query_arg('tag', _x('featured', 'featured content default tag slug', 'twentyfourteen'), admin_url('edit.php'))),
56
+			admin_url('edit.php?show_sticky=1')
57 57
 		),
58 58
 		'priority'        => 130,
59 59
 		'active_callback' => 'is_front_page',
60
-	) );
60
+	));
61 61
 
62 62
 	// Add the featured content layout setting and control.
63
-	$wp_customize->add_setting( 'featured_content_layout', array(
63
+	$wp_customize->add_setting('featured_content_layout', array(
64 64
 		'default'           => 'grid',
65 65
 		'sanitize_callback' => 'twentyfourteen_sanitize_layout',
66
-	) );
66
+	));
67 67
 
68
-	$wp_customize->add_control( 'featured_content_layout', array(
69
-		'label'   => __( 'Layout', 'twentyfourteen' ),
68
+	$wp_customize->add_control('featured_content_layout', array(
69
+		'label'   => __('Layout', 'twentyfourteen'),
70 70
 		'section' => 'featured_content',
71 71
 		'type'    => 'select',
72 72
 		'choices' => array(
73
-			'grid'   => __( 'Grid',   'twentyfourteen' ),
74
-			'slider' => __( 'Slider', 'twentyfourteen' ),
73
+			'grid'   => __('Grid', 'twentyfourteen'),
74
+			'slider' => __('Slider', 'twentyfourteen'),
75 75
 		),
76
-	) );
76
+	));
77 77
 }
78
-add_action( 'customize_register', 'twentyfourteen_customize_register' );
78
+add_action('customize_register', 'twentyfourteen_customize_register');
79 79
 
80 80
 /**
81 81
  * Render the site title for the selective refresh partial.
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
  * @return void
87 87
  */
88 88
 function twentyfourteen_customize_partial_blogname() {
89
-	bloginfo( 'name' );
89
+	bloginfo('name');
90 90
 }
91 91
 
92 92
 /**
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
  * @return void
99 99
  */
100 100
 function twentyfourteen_customize_partial_blogdescription() {
101
-	bloginfo( 'description' );
101
+	bloginfo('description');
102 102
 }
103 103
 
104 104
 /**
@@ -109,8 +109,8 @@  discard block
 block discarded – undo
109 109
  * @param string $layout Layout type.
110 110
  * @return string Filtered layout type (grid|slider).
111 111
  */
112
-function twentyfourteen_sanitize_layout( $layout ) {
113
-	if ( ! in_array( $layout, array( 'grid', 'slider' ) ) ) {
112
+function twentyfourteen_sanitize_layout($layout) {
113
+	if ( ! in_array($layout, array('grid', 'slider'))) {
114 114
 		$layout = 'grid';
115 115
 	}
116 116
 
@@ -123,9 +123,9 @@  discard block
 block discarded – undo
123 123
  * @since Twenty Fourteen 1.0
124 124
  */
125 125
 function twentyfourteen_customize_preview_js() {
126
-	wp_enqueue_script( 'twentyfourteen_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20131205', true );
126
+	wp_enqueue_script('twentyfourteen_customizer', get_template_directory_uri().'/js/customizer.js', array('customize-preview'), '20131205', true);
127 127
 }
128
-add_action( 'customize_preview_init', 'twentyfourteen_customize_preview_js' );
128
+add_action('customize_preview_init', 'twentyfourteen_customize_preview_js');
129 129
 
130 130
 /**
131 131
  * Add contextual help to the Themes and Post edit screens.
@@ -133,20 +133,20 @@  discard block
 block discarded – undo
133 133
  * @since Twenty Fourteen 1.0
134 134
  */
135 135
 function twentyfourteen_contextual_help() {
136
-	if ( 'admin_head-edit.php' === current_filter() && 'post' !== $GLOBALS['typenow'] ) {
136
+	if ('admin_head-edit.php' === current_filter() && 'post' !== $GLOBALS['typenow']) {
137 137
 		return;
138 138
 	}
139 139
 
140
-	get_current_screen()->add_help_tab( array(
140
+	get_current_screen()->add_help_tab(array(
141 141
 		'id'      => 'twentyfourteen',
142
-		'title'   => __( 'Twenty Fourteen', 'twentyfourteen' ),
142
+		'title'   => __('Twenty Fourteen', 'twentyfourteen'),
143 143
 		'content' =>
144
-			'<ul>' .
145
-				'<li>' . sprintf( __( 'The home page features your choice of up to 6 posts prominently displayed in a grid or slider, controlled by a <a href="%1$s">tag</a>; you can change the tag and layout in <a href="%2$s">Appearance &rarr; Customize</a>. If no posts match the tag, <a href="%3$s">sticky posts</a> will be displayed instead.', 'twentyfourteen' ), esc_url( add_query_arg( 'tag', _x( 'featured', 'featured content default tag slug', 'twentyfourteen' ), admin_url( 'edit.php' ) ) ), admin_url( 'customize.php' ), admin_url( 'edit.php?show_sticky=1' ) ) . '</li>' .
146
-				'<li>' . sprintf( __( 'Enhance your site design by using <a href="%s">Featured Images</a> for posts you&rsquo;d like to stand out (also known as post thumbnails). This allows you to associate an image with your post without inserting it. Twenty Fourteen uses featured images for posts and pages&mdash;above the title&mdash;and in the Featured Content area on the home page.', 'twentyfourteen' ), 'https://codex.wordpress.org/Post_Thumbnails#Setting_a_Post_Thumbnail' ) . '</li>' .
147
-				'<li>' . sprintf( __( 'For an in-depth tutorial, and more tips and tricks, visit the <a href="%s">Twenty Fourteen documentation</a>.', 'twentyfourteen' ), 'https://codex.wordpress.org/Twenty_Fourteen' ) . '</li>' .
144
+			'<ul>'.
145
+				'<li>'.sprintf(__('The home page features your choice of up to 6 posts prominently displayed in a grid or slider, controlled by a <a href="%1$s">tag</a>; you can change the tag and layout in <a href="%2$s">Appearance &rarr; Customize</a>. If no posts match the tag, <a href="%3$s">sticky posts</a> will be displayed instead.', 'twentyfourteen'), esc_url(add_query_arg('tag', _x('featured', 'featured content default tag slug', 'twentyfourteen'), admin_url('edit.php'))), admin_url('customize.php'), admin_url('edit.php?show_sticky=1')).'</li>'.
146
+				'<li>'.sprintf(__('Enhance your site design by using <a href="%s">Featured Images</a> for posts you&rsquo;d like to stand out (also known as post thumbnails). This allows you to associate an image with your post without inserting it. Twenty Fourteen uses featured images for posts and pages&mdash;above the title&mdash;and in the Featured Content area on the home page.', 'twentyfourteen'), 'https://codex.wordpress.org/Post_Thumbnails#Setting_a_Post_Thumbnail').'</li>'.
147
+				'<li>'.sprintf(__('For an in-depth tutorial, and more tips and tricks, visit the <a href="%s">Twenty Fourteen documentation</a>.', 'twentyfourteen'), 'https://codex.wordpress.org/Twenty_Fourteen').'</li>'.
148 148
 			'</ul>',
149
-	) );
149
+	));
150 150
 }
151
-add_action( 'admin_head-themes.php', 'twentyfourteen_contextual_help' );
152
-add_action( 'admin_head-edit.php',   'twentyfourteen_contextual_help' );
151
+add_action('admin_head-themes.php', 'twentyfourteen_contextual_help');
152
+add_action('admin_head-edit.php', 'twentyfourteen_contextual_help');
Please login to merge, or discard this patch.
src/wp-content/themes/twentyfifteen/functions.php 1 patch
Spacing   +89 added lines, -89 removed lines patch added patch discarded remove patch
@@ -30,18 +30,18 @@  discard block
 block discarded – undo
30 30
  *
31 31
  * @since Twenty Fifteen 1.0
32 32
  */
33
-if ( ! isset( $content_width ) ) {
33
+if ( ! isset($content_width)) {
34 34
 	$content_width = 660;
35 35
 }
36 36
 
37 37
 /**
38 38
  * Twenty Fifteen only works in WordPress 4.1 or later.
39 39
  */
40
-if ( version_compare( $GLOBALS['wp_version'], '4.1-alpha', '<' ) ) {
41
-	require get_template_directory() . '/inc/back-compat.php';
40
+if (version_compare($GLOBALS['wp_version'], '4.1-alpha', '<')) {
41
+	require get_template_directory().'/inc/back-compat.php';
42 42
 }
43 43
 
44
-if ( ! function_exists( 'twentyfifteen_setup' ) ) :
44
+if ( ! function_exists('twentyfifteen_setup')) :
45 45
 /**
46 46
  * Sets up theme defaults and registers support for various WordPress features.
47 47
  *
@@ -59,10 +59,10 @@  discard block
 block discarded – undo
59 59
 	 * If you're building a theme based on twentyfifteen, use a find and replace
60 60
 	 * to change 'twentyfifteen' to the name of your theme in all the template files
61 61
 	 */
62
-	load_theme_textdomain( 'twentyfifteen' );
62
+	load_theme_textdomain('twentyfifteen');
63 63
 
64 64
 	// Add default posts and comments RSS feed links to head.
65
-	add_theme_support( 'automatic-feed-links' );
65
+	add_theme_support('automatic-feed-links');
66 66
 
67 67
 	/*
68 68
 	 * Let WordPress manage the document title.
@@ -70,52 +70,52 @@  discard block
 block discarded – undo
70 70
 	 * hard-coded <title> tag in the document head, and expect WordPress to
71 71
 	 * provide it for us.
72 72
 	 */
73
-	add_theme_support( 'title-tag' );
73
+	add_theme_support('title-tag');
74 74
 
75 75
 	/*
76 76
 	 * Enable support for Post Thumbnails on posts and pages.
77 77
 	 *
78 78
 	 * See: https://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
79 79
 	 */
80
-	add_theme_support( 'post-thumbnails' );
81
-	set_post_thumbnail_size( 825, 510, true );
80
+	add_theme_support('post-thumbnails');
81
+	set_post_thumbnail_size(825, 510, true);
82 82
 
83 83
 	// This theme uses wp_nav_menu() in two locations.
84
-	register_nav_menus( array(
85
-		'primary' => __( 'Primary Menu',      'twentyfifteen' ),
86
-		'social'  => __( 'Social Links Menu', 'twentyfifteen' ),
87
-	) );
84
+	register_nav_menus(array(
85
+		'primary' => __('Primary Menu', 'twentyfifteen'),
86
+		'social'  => __('Social Links Menu', 'twentyfifteen'),
87
+	));
88 88
 
89 89
 	/*
90 90
 	 * Switch default core markup for search form, comment form, and comments
91 91
 	 * to output valid HTML5.
92 92
 	 */
93
-	add_theme_support( 'html5', array(
93
+	add_theme_support('html5', array(
94 94
 		'search-form', 'comment-form', 'comment-list', 'gallery', 'caption'
95
-	) );
95
+	));
96 96
 
97 97
 	/*
98 98
 	 * Enable support for Post Formats.
99 99
 	 *
100 100
 	 * See: https://codex.wordpress.org/Post_Formats
101 101
 	 */
102
-	add_theme_support( 'post-formats', array(
102
+	add_theme_support('post-formats', array(
103 103
 		'aside', 'image', 'video', 'quote', 'link', 'gallery', 'status', 'audio', 'chat'
104
-	) );
104
+	));
105 105
 
106 106
 	/*
107 107
 	 * Enable support for custom logo.
108 108
 	 *
109 109
 	 * @since Twenty Fifteen 1.5
110 110
 	 */
111
-	add_theme_support( 'custom-logo', array(
111
+	add_theme_support('custom-logo', array(
112 112
 		'height'      => 248,
113 113
 		'width'       => 248,
114 114
 		'flex-height' => true,
115
-	) );
115
+	));
116 116
 
117 117
 	$color_scheme  = twentyfifteen_get_color_scheme();
118
-	$default_color = trim( $color_scheme[0], '#' );
118
+	$default_color = trim($color_scheme[0], '#');
119 119
 
120 120
 	// Setup the WordPress core custom background feature.
121 121
 
@@ -131,22 +131,22 @@  discard block
 block discarded – undo
131 131
 	 *     @type string $default-attachment     Default attachment of the header.
132 132
 	 * }
133 133
 	 */
134
-	add_theme_support( 'custom-background', apply_filters( 'twentyfifteen_custom_background_args', array(
134
+	add_theme_support('custom-background', apply_filters('twentyfifteen_custom_background_args', array(
135 135
 		'default-color'      => $default_color,
136 136
 		'default-attachment' => 'fixed',
137
-	) ) );
137
+	)));
138 138
 
139 139
 	/*
140 140
 	 * This theme styles the visual editor to resemble the theme style,
141 141
 	 * specifically font, colors, icons, and column width.
142 142
 	 */
143
-	add_editor_style( array( 'css/editor-style.css', 'genericons/genericons.css', twentyfifteen_fonts_url() ) );
143
+	add_editor_style(array('css/editor-style.css', 'genericons/genericons.css', twentyfifteen_fonts_url()));
144 144
 
145 145
 	// Indicate widget sidebars can use selective refresh in the Customizer.
146
-	add_theme_support( 'customize-selective-refresh-widgets' );
146
+	add_theme_support('customize-selective-refresh-widgets');
147 147
 }
148 148
 endif; // twentyfifteen_setup
149
-add_action( 'after_setup_theme', 'twentyfifteen_setup' );
149
+add_action('after_setup_theme', 'twentyfifteen_setup');
150 150
 
151 151
 /**
152 152
  * Register widget area.
@@ -156,19 +156,19 @@  discard block
 block discarded – undo
156 156
  * @link https://codex.wordpress.org/Function_Reference/register_sidebar
157 157
  */
158 158
 function twentyfifteen_widgets_init() {
159
-	register_sidebar( array(
160
-		'name'          => __( 'Widget Area', 'twentyfifteen' ),
159
+	register_sidebar(array(
160
+		'name'          => __('Widget Area', 'twentyfifteen'),
161 161
 		'id'            => 'sidebar-1',
162
-		'description'   => __( 'Add widgets here to appear in your sidebar.', 'twentyfifteen' ),
162
+		'description'   => __('Add widgets here to appear in your sidebar.', 'twentyfifteen'),
163 163
 		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
164 164
 		'after_widget'  => '</aside>',
165 165
 		'before_title'  => '<h2 class="widget-title">',
166 166
 		'after_title'   => '</h2>',
167
-	) );
167
+	));
168 168
 }
169
-add_action( 'widgets_init', 'twentyfifteen_widgets_init' );
169
+add_action('widgets_init', 'twentyfifteen_widgets_init');
170 170
 
171
-if ( ! function_exists( 'twentyfifteen_fonts_url' ) ) :
171
+if ( ! function_exists('twentyfifteen_fonts_url')) :
172 172
 /**
173 173
  * Register Google fonts for Twenty Fifteen.
174 174
  *
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 	 * Translators: If there are characters in your language that are not supported
186 186
 	 * by Noto Sans, translate this to 'off'. Do not translate into your own language.
187 187
 	 */
188
-	if ( 'off' !== _x( 'on', 'Noto Sans font: on or off', 'twentyfifteen' ) ) {
188
+	if ('off' !== _x('on', 'Noto Sans font: on or off', 'twentyfifteen')) {
189 189
 		$fonts[] = 'Noto Sans:400italic,700italic,400,700';
190 190
 	}
191 191
 
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 	 * Translators: If there are characters in your language that are not supported
194 194
 	 * by Noto Serif, translate this to 'off'. Do not translate into your own language.
195 195
 	 */
196
-	if ( 'off' !== _x( 'on', 'Noto Serif font: on or off', 'twentyfifteen' ) ) {
196
+	if ('off' !== _x('on', 'Noto Serif font: on or off', 'twentyfifteen')) {
197 197
 		$fonts[] = 'Noto Serif:400italic,700italic,400,700';
198 198
 	}
199 199
 
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 	 * Translators: If there are characters in your language that are not supported
202 202
 	 * by Inconsolata, translate this to 'off'. Do not translate into your own language.
203 203
 	 */
204
-	if ( 'off' !== _x( 'on', 'Inconsolata font: on or off', 'twentyfifteen' ) ) {
204
+	if ('off' !== _x('on', 'Inconsolata font: on or off', 'twentyfifteen')) {
205 205
 		$fonts[] = 'Inconsolata:400,700';
206 206
 	}
207 207
 
@@ -209,23 +209,23 @@  discard block
 block discarded – undo
209 209
 	 * Translators: To add an additional character subset specific to your language,
210 210
 	 * translate this to 'greek', 'cyrillic', 'devanagari' or 'vietnamese'. Do not translate into your own language.
211 211
 	 */
212
-	$subset = _x( 'no-subset', 'Add new subset (greek, cyrillic, devanagari, vietnamese)', 'twentyfifteen' );
212
+	$subset = _x('no-subset', 'Add new subset (greek, cyrillic, devanagari, vietnamese)', 'twentyfifteen');
213 213
 
214
-	if ( 'cyrillic' == $subset ) {
214
+	if ('cyrillic' == $subset) {
215 215
 		$subsets .= ',cyrillic,cyrillic-ext';
216
-	} elseif ( 'greek' == $subset ) {
216
+	} elseif ('greek' == $subset) {
217 217
 		$subsets .= ',greek,greek-ext';
218
-	} elseif ( 'devanagari' == $subset ) {
218
+	} elseif ('devanagari' == $subset) {
219 219
 		$subsets .= ',devanagari';
220
-	} elseif ( 'vietnamese' == $subset ) {
220
+	} elseif ('vietnamese' == $subset) {
221 221
 		$subsets .= ',vietnamese';
222 222
 	}
223 223
 
224
-	if ( $fonts ) {
225
-		$fonts_url = add_query_arg( array(
226
-			'family' => urlencode( implode( '|', $fonts ) ),
227
-			'subset' => urlencode( $subsets ),
228
-		), 'https://fonts.googleapis.com/css' );
224
+	if ($fonts) {
225
+		$fonts_url = add_query_arg(array(
226
+			'family' => urlencode(implode('|', $fonts)),
227
+			'subset' => urlencode($subsets),
228
+		), 'https://fonts.googleapis.com/css');
229 229
 	}
230 230
 
231 231
 	return $fonts_url;
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
 function twentyfifteen_javascript_detection() {
243 243
 	echo "<script>(function(html){html.className = html.className.replace(/\bno-js\b/,'js')})(document.documentElement);</script>\n";
244 244
 }
245
-add_action( 'wp_head', 'twentyfifteen_javascript_detection', 0 );
245
+add_action('wp_head', 'twentyfifteen_javascript_detection', 0);
246 246
 
247 247
 /**
248 248
  * Enqueue scripts and styles.
@@ -251,39 +251,39 @@  discard block
 block discarded – undo
251 251
  */
252 252
 function twentyfifteen_scripts() {
253 253
 	// Add custom fonts, used in the main stylesheet.
254
-	wp_enqueue_style( 'twentyfifteen-fonts', twentyfifteen_fonts_url(), array(), null );
254
+	wp_enqueue_style('twentyfifteen-fonts', twentyfifteen_fonts_url(), array(), null);
255 255
 
256 256
 	// Add Genericons, used in the main stylesheet.
257
-	wp_enqueue_style( 'genericons', get_template_directory_uri() . '/genericons/genericons.css', array(), '3.2' );
257
+	wp_enqueue_style('genericons', get_template_directory_uri().'/genericons/genericons.css', array(), '3.2');
258 258
 
259 259
 	// Load our main stylesheet.
260
-	wp_enqueue_style( 'twentyfifteen-style', get_stylesheet_uri() );
260
+	wp_enqueue_style('twentyfifteen-style', get_stylesheet_uri());
261 261
 
262 262
 	// Load the Internet Explorer specific stylesheet.
263
-	wp_enqueue_style( 'twentyfifteen-ie', get_template_directory_uri() . '/css/ie.css', array( 'twentyfifteen-style' ), '20141010' );
264
-	wp_style_add_data( 'twentyfifteen-ie', 'conditional', 'lt IE 9' );
263
+	wp_enqueue_style('twentyfifteen-ie', get_template_directory_uri().'/css/ie.css', array('twentyfifteen-style'), '20141010');
264
+	wp_style_add_data('twentyfifteen-ie', 'conditional', 'lt IE 9');
265 265
 
266 266
 	// Load the Internet Explorer 7 specific stylesheet.
267
-	wp_enqueue_style( 'twentyfifteen-ie7', get_template_directory_uri() . '/css/ie7.css', array( 'twentyfifteen-style' ), '20141010' );
268
-	wp_style_add_data( 'twentyfifteen-ie7', 'conditional', 'lt IE 8' );
267
+	wp_enqueue_style('twentyfifteen-ie7', get_template_directory_uri().'/css/ie7.css', array('twentyfifteen-style'), '20141010');
268
+	wp_style_add_data('twentyfifteen-ie7', 'conditional', 'lt IE 8');
269 269
 
270
-	wp_enqueue_script( 'twentyfifteen-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20141010', true );
270
+	wp_enqueue_script('twentyfifteen-skip-link-focus-fix', get_template_directory_uri().'/js/skip-link-focus-fix.js', array(), '20141010', true);
271 271
 
272
-	if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
273
-		wp_enqueue_script( 'comment-reply' );
272
+	if (is_singular() && comments_open() && get_option('thread_comments')) {
273
+		wp_enqueue_script('comment-reply');
274 274
 	}
275 275
 
276
-	if ( is_singular() && wp_attachment_is_image() ) {
277
-		wp_enqueue_script( 'twentyfifteen-keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20141010' );
276
+	if (is_singular() && wp_attachment_is_image()) {
277
+		wp_enqueue_script('twentyfifteen-keyboard-image-navigation', get_template_directory_uri().'/js/keyboard-image-navigation.js', array('jquery'), '20141010');
278 278
 	}
279 279
 
280
-	wp_enqueue_script( 'twentyfifteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20150330', true );
281
-	wp_localize_script( 'twentyfifteen-script', 'screenReaderText', array(
282
-		'expand'   => '<span class="screen-reader-text">' . __( 'expand child menu', 'twentyfifteen' ) . '</span>',
283
-		'collapse' => '<span class="screen-reader-text">' . __( 'collapse child menu', 'twentyfifteen' ) . '</span>',
284
-	) );
280
+	wp_enqueue_script('twentyfifteen-script', get_template_directory_uri().'/js/functions.js', array('jquery'), '20150330', true);
281
+	wp_localize_script('twentyfifteen-script', 'screenReaderText', array(
282
+		'expand'   => '<span class="screen-reader-text">'.__('expand child menu', 'twentyfifteen').'</span>',
283
+		'collapse' => '<span class="screen-reader-text">'.__('collapse child menu', 'twentyfifteen').'</span>',
284
+	));
285 285
 }
286
-add_action( 'wp_enqueue_scripts', 'twentyfifteen_scripts' );
286
+add_action('wp_enqueue_scripts', 'twentyfifteen_scripts');
287 287
 
288 288
 /**
289 289
  * Add preconnect for Google Fonts.
@@ -294,9 +294,9 @@  discard block
 block discarded – undo
294 294
  * @param string  $relation_type The relation type the URLs are printed.
295 295
  * @return array URLs to print for resource hints.
296 296
  */
297
-function twentyfifteen_resource_hints( $urls, $relation_type ) {
298
-	if ( wp_style_is( 'twentyfifteen-fonts', 'queue' ) && 'preconnect' === $relation_type ) {
299
-		if ( version_compare( $GLOBALS['wp_version'], '4.7-alpha', '>=' ) ) {
297
+function twentyfifteen_resource_hints($urls, $relation_type) {
298
+	if (wp_style_is('twentyfifteen-fonts', 'queue') && 'preconnect' === $relation_type) {
299
+		if (version_compare($GLOBALS['wp_version'], '4.7-alpha', '>=')) {
300 300
 			$urls[] = array(
301 301
 				'href' => 'https://fonts.gstatic.com',
302 302
 				'crossorigin',
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
 
309 309
 	return $urls;
310 310
 }
311
-add_filter( 'wp_resource_hints', 'twentyfifteen_resource_hints', 10, 2 );
311
+add_filter('wp_resource_hints', 'twentyfifteen_resource_hints', 10, 2);
312 312
 
313 313
 /**
314 314
  * Add featured image as background image to post navigation elements.
@@ -318,39 +318,39 @@  discard block
 block discarded – undo
318 318
  * @see wp_add_inline_style()
319 319
  */
320 320
 function twentyfifteen_post_nav_background() {
321
-	if ( ! is_single() ) {
321
+	if ( ! is_single()) {
322 322
 		return;
323 323
 	}
324 324
 
325
-	$previous = ( is_attachment() ) ? get_post( get_post()->post_parent ) : get_adjacent_post( false, '', true );
326
-	$next     = get_adjacent_post( false, '', false );
325
+	$previous = (is_attachment()) ? get_post(get_post()->post_parent) : get_adjacent_post(false, '', true);
326
+	$next     = get_adjacent_post(false, '', false);
327 327
 	$css      = '';
328 328
 
329
-	if ( is_attachment() && 'attachment' == $previous->post_type ) {
329
+	if (is_attachment() && 'attachment' == $previous->post_type) {
330 330
 		return;
331 331
 	}
332 332
 
333
-	if ( $previous &&  has_post_thumbnail( $previous->ID ) ) {
334
-		$prevthumb = wp_get_attachment_image_src( get_post_thumbnail_id( $previous->ID ), 'post-thumbnail' );
333
+	if ($previous && has_post_thumbnail($previous->ID)) {
334
+		$prevthumb = wp_get_attachment_image_src(get_post_thumbnail_id($previous->ID), 'post-thumbnail');
335 335
 		$css .= '
336
-			.post-navigation .nav-previous { background-image: url(' . esc_url( $prevthumb[0] ) . '); }
336
+			.post-navigation .nav-previous { background-image: url(' . esc_url($prevthumb[0]).'); }
337 337
 			.post-navigation .nav-previous .post-title, .post-navigation .nav-previous a:hover .post-title, .post-navigation .nav-previous .meta-nav { color: #fff; }
338 338
 			.post-navigation .nav-previous a:before { background-color: rgba(0, 0, 0, 0.4); }
339 339
 		';
340 340
 	}
341 341
 
342
-	if ( $next && has_post_thumbnail( $next->ID ) ) {
343
-		$nextthumb = wp_get_attachment_image_src( get_post_thumbnail_id( $next->ID ), 'post-thumbnail' );
342
+	if ($next && has_post_thumbnail($next->ID)) {
343
+		$nextthumb = wp_get_attachment_image_src(get_post_thumbnail_id($next->ID), 'post-thumbnail');
344 344
 		$css .= '
345
-			.post-navigation .nav-next { background-image: url(' . esc_url( $nextthumb[0] ) . '); border-top: 0; }
345
+			.post-navigation .nav-next { background-image: url(' . esc_url($nextthumb[0]).'); border-top: 0; }
346 346
 			.post-navigation .nav-next .post-title, .post-navigation .nav-next a:hover .post-title, .post-navigation .nav-next .meta-nav { color: #fff; }
347 347
 			.post-navigation .nav-next a:before { background-color: rgba(0, 0, 0, 0.4); }
348 348
 		';
349 349
 	}
350 350
 
351
-	wp_add_inline_style( 'twentyfifteen-style', $css );
351
+	wp_add_inline_style('twentyfifteen-style', $css);
352 352
 }
353
-add_action( 'wp_enqueue_scripts', 'twentyfifteen_post_nav_background' );
353
+add_action('wp_enqueue_scripts', 'twentyfifteen_post_nav_background');
354 354
 
355 355
 /**
356 356
  * Display descriptions in main navigation.
@@ -363,14 +363,14 @@  discard block
 block discarded – undo
363 363
  * @param array   $args        wp_nav_menu() arguments.
364 364
  * @return string Menu item with possible description.
365 365
  */
366
-function twentyfifteen_nav_description( $item_output, $item, $depth, $args ) {
367
-	if ( 'primary' == $args->theme_location && $item->description ) {
368
-		$item_output = str_replace( $args->link_after . '</a>', '<div class="menu-item-description">' . $item->description . '</div>' . $args->link_after . '</a>', $item_output );
366
+function twentyfifteen_nav_description($item_output, $item, $depth, $args) {
367
+	if ('primary' == $args->theme_location && $item->description) {
368
+		$item_output = str_replace($args->link_after.'</a>', '<div class="menu-item-description">'.$item->description.'</div>'.$args->link_after.'</a>', $item_output);
369 369
 	}
370 370
 
371 371
 	return $item_output;
372 372
 }
373
-add_filter( 'walker_nav_menu_start_el', 'twentyfifteen_nav_description', 10, 4 );
373
+add_filter('walker_nav_menu_start_el', 'twentyfifteen_nav_description', 10, 4);
374 374
 
375 375
 /**
376 376
  * Add a `screen-reader-text` class to the search form's submit button.
@@ -380,28 +380,28 @@  discard block
 block discarded – undo
380 380
  * @param string $html Search form HTML.
381 381
  * @return string Modified search form HTML.
382 382
  */
383
-function twentyfifteen_search_form_modify( $html ) {
384
-	return str_replace( 'class="search-submit"', 'class="search-submit screen-reader-text"', $html );
383
+function twentyfifteen_search_form_modify($html) {
384
+	return str_replace('class="search-submit"', 'class="search-submit screen-reader-text"', $html);
385 385
 }
386
-add_filter( 'get_search_form', 'twentyfifteen_search_form_modify' );
386
+add_filter('get_search_form', 'twentyfifteen_search_form_modify');
387 387
 
388 388
 /**
389 389
  * Implement the Custom Header feature.
390 390
  *
391 391
  * @since Twenty Fifteen 1.0
392 392
  */
393
-require get_template_directory() . '/inc/custom-header.php';
393
+require get_template_directory().'/inc/custom-header.php';
394 394
 
395 395
 /**
396 396
  * Custom template tags for this theme.
397 397
  *
398 398
  * @since Twenty Fifteen 1.0
399 399
  */
400
-require get_template_directory() . '/inc/template-tags.php';
400
+require get_template_directory().'/inc/template-tags.php';
401 401
 
402 402
 /**
403 403
  * Customizer additions.
404 404
  *
405 405
  * @since Twenty Fifteen 1.0
406 406
  */
407
-require get_template_directory() . '/inc/customizer.php';
407
+require get_template_directory().'/inc/customizer.php';
Please login to merge, or discard this patch.
src/wp-content/themes/twentythirteen/functions.php 2 patches
Spacing   +141 added lines, -141 removed lines patch added patch discarded remove patch
@@ -28,19 +28,19 @@  discard block
 block discarded – undo
28 28
  *
29 29
  * @see twentythirteen_content_width() for template-specific adjustments.
30 30
  */
31
-if ( ! isset( $content_width ) )
31
+if ( ! isset($content_width))
32 32
 	$content_width = 604;
33 33
 
34 34
 /**
35 35
  * Add support for a custom header image.
36 36
  */
37
-require get_template_directory() . '/inc/custom-header.php';
37
+require get_template_directory().'/inc/custom-header.php';
38 38
 
39 39
 /**
40 40
  * Twenty Thirteen only works in WordPress 3.6 or later.
41 41
  */
42
-if ( version_compare( $GLOBALS['wp_version'], '3.6-alpha', '<' ) )
43
-	require get_template_directory() . '/inc/back-compat.php';
42
+if (version_compare($GLOBALS['wp_version'], '3.6-alpha', '<'))
43
+	require get_template_directory().'/inc/back-compat.php';
44 44
 
45 45
 /**
46 46
  * Twenty Thirteen setup.
@@ -66,50 +66,50 @@  discard block
 block discarded – undo
66 66
 	 * replace to change 'twentythirteen' to the name of your theme in all
67 67
 	 * template files.
68 68
 	 */
69
-	load_theme_textdomain( 'twentythirteen' );
69
+	load_theme_textdomain('twentythirteen');
70 70
 
71 71
 	/*
72 72
 	 * This theme styles the visual editor to resemble the theme style,
73 73
 	 * specifically font, colors, icons, and column width.
74 74
 	 */
75
-	add_editor_style( array( 'css/editor-style.css', 'genericons/genericons.css', twentythirteen_fonts_url() ) );
75
+	add_editor_style(array('css/editor-style.css', 'genericons/genericons.css', twentythirteen_fonts_url()));
76 76
 
77 77
 	// Adds RSS feed links to <head> for posts and comments.
78
-	add_theme_support( 'automatic-feed-links' );
78
+	add_theme_support('automatic-feed-links');
79 79
 
80 80
 	/*
81 81
 	 * Switches default core markup for search form, comment form,
82 82
 	 * and comments to output valid HTML5.
83 83
 	 */
84
-	add_theme_support( 'html5', array(
84
+	add_theme_support('html5', array(
85 85
 		'search-form', 'comment-form', 'comment-list', 'gallery', 'caption'
86
-	) );
86
+	));
87 87
 
88 88
 	/*
89 89
 	 * This theme supports all available post formats by default.
90 90
 	 * See https://codex.wordpress.org/Post_Formats
91 91
 	 */
92
-	add_theme_support( 'post-formats', array(
92
+	add_theme_support('post-formats', array(
93 93
 		'aside', 'audio', 'chat', 'gallery', 'image', 'link', 'quote', 'status', 'video'
94
-	) );
94
+	));
95 95
 
96 96
 	// This theme uses wp_nav_menu() in one location.
97
-	register_nav_menu( 'primary', __( 'Navigation Menu', 'twentythirteen' ) );
97
+	register_nav_menu('primary', __('Navigation Menu', 'twentythirteen'));
98 98
 
99 99
 	/*
100 100
 	 * This theme uses a custom image size for featured images, displayed on
101 101
 	 * "standard" posts and pages.
102 102
 	 */
103
-	add_theme_support( 'post-thumbnails' );
104
-	set_post_thumbnail_size( 604, 270, true );
103
+	add_theme_support('post-thumbnails');
104
+	set_post_thumbnail_size(604, 270, true);
105 105
 
106 106
 	// This theme uses its own gallery styles.
107
-	add_filter( 'use_default_gallery_style', '__return_false' );
107
+	add_filter('use_default_gallery_style', '__return_false');
108 108
 
109 109
 	// Indicate widget sidebars can use selective refresh in the Customizer.
110
-	add_theme_support( 'customize-selective-refresh-widgets' );
110
+	add_theme_support('customize-selective-refresh-widgets');
111 111
 }
112
-add_action( 'after_setup_theme', 'twentythirteen_setup' );
112
+add_action('after_setup_theme', 'twentythirteen_setup');
113 113
 
114 114
 /**
115 115
  * Return the Google font stylesheet URL, if available.
@@ -128,28 +128,28 @@  discard block
 block discarded – undo
128 128
 	 * supported by Source Sans Pro, translate this to 'off'. Do not translate
129 129
 	 * into your own language.
130 130
 	 */
131
-	$source_sans_pro = _x( 'on', 'Source Sans Pro font: on or off', 'twentythirteen' );
131
+	$source_sans_pro = _x('on', 'Source Sans Pro font: on or off', 'twentythirteen');
132 132
 
133 133
 	/* Translators: If there are characters in your language that are not
134 134
 	 * supported by Bitter, translate this to 'off'. Do not translate into your
135 135
 	 * own language.
136 136
 	 */
137
-	$bitter = _x( 'on', 'Bitter font: on or off', 'twentythirteen' );
137
+	$bitter = _x('on', 'Bitter font: on or off', 'twentythirteen');
138 138
 
139
-	if ( 'off' !== $source_sans_pro || 'off' !== $bitter ) {
139
+	if ('off' !== $source_sans_pro || 'off' !== $bitter) {
140 140
 		$font_families = array();
141 141
 
142
-		if ( 'off' !== $source_sans_pro )
142
+		if ('off' !== $source_sans_pro)
143 143
 			$font_families[] = 'Source Sans Pro:300,400,700,300italic,400italic,700italic';
144 144
 
145
-		if ( 'off' !== $bitter )
145
+		if ('off' !== $bitter)
146 146
 			$font_families[] = 'Bitter:400,700';
147 147
 
148 148
 		$query_args = array(
149
-			'family' => urlencode( implode( '|', $font_families ) ),
150
-			'subset' => urlencode( 'latin,latin-ext' ),
149
+			'family' => urlencode(implode('|', $font_families)),
150
+			'subset' => urlencode('latin,latin-ext'),
151 151
 		);
152
-		$fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' );
152
+		$fonts_url = add_query_arg($query_args, 'https://fonts.googleapis.com/css');
153 153
 	}
154 154
 
155 155
 	return $fonts_url;
@@ -165,30 +165,30 @@  discard block
 block discarded – undo
165 165
 	 * Adds JavaScript to pages with the comment form to support
166 166
 	 * sites with threaded comments (when in use).
167 167
 	 */
168
-	if ( is_singular() && comments_open() && get_option( 'thread_comments' ) )
169
-		wp_enqueue_script( 'comment-reply' );
168
+	if (is_singular() && comments_open() && get_option('thread_comments'))
169
+		wp_enqueue_script('comment-reply');
170 170
 
171 171
 	// Adds Masonry to handle vertical alignment of footer widgets.
172
-	if ( is_active_sidebar( 'sidebar-1' ) )
173
-		wp_enqueue_script( 'jquery-masonry' );
172
+	if (is_active_sidebar('sidebar-1'))
173
+		wp_enqueue_script('jquery-masonry');
174 174
 
175 175
 	// Loads JavaScript file with functionality specific to Twenty Thirteen.
176
-	wp_enqueue_script( 'twentythirteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20160717', true );
176
+	wp_enqueue_script('twentythirteen-script', get_template_directory_uri().'/js/functions.js', array('jquery'), '20160717', true);
177 177
 
178 178
 	// Add Source Sans Pro and Bitter fonts, used in the main stylesheet.
179
-	wp_enqueue_style( 'twentythirteen-fonts', twentythirteen_fonts_url(), array(), null );
179
+	wp_enqueue_style('twentythirteen-fonts', twentythirteen_fonts_url(), array(), null);
180 180
 
181 181
 	// Add Genericons font, used in the main stylesheet.
182
-	wp_enqueue_style( 'genericons', get_template_directory_uri() . '/genericons/genericons.css', array(), '3.03' );
182
+	wp_enqueue_style('genericons', get_template_directory_uri().'/genericons/genericons.css', array(), '3.03');
183 183
 
184 184
 	// Loads our main stylesheet.
185
-	wp_enqueue_style( 'twentythirteen-style', get_stylesheet_uri(), array(), '2013-07-18' );
185
+	wp_enqueue_style('twentythirteen-style', get_stylesheet_uri(), array(), '2013-07-18');
186 186
 
187 187
 	// Loads the Internet Explorer specific stylesheet.
188
-	wp_enqueue_style( 'twentythirteen-ie', get_template_directory_uri() . '/css/ie.css', array( 'twentythirteen-style' ), '2013-07-18' );
189
-	wp_style_add_data( 'twentythirteen-ie', 'conditional', 'lt IE 9' );
188
+	wp_enqueue_style('twentythirteen-ie', get_template_directory_uri().'/css/ie.css', array('twentythirteen-style'), '2013-07-18');
189
+	wp_style_add_data('twentythirteen-ie', 'conditional', 'lt IE 9');
190 190
 }
191
-add_action( 'wp_enqueue_scripts', 'twentythirteen_scripts_styles' );
191
+add_action('wp_enqueue_scripts', 'twentythirteen_scripts_styles');
192 192
 
193 193
 /**
194 194
  * Add preconnect for Google Fonts.
@@ -199,9 +199,9 @@  discard block
 block discarded – undo
199 199
  * @param string  $relation_type The relation type the URLs are printed.
200 200
  * @return array URLs to print for resource hints.
201 201
  */
202
-function twentythirteen_resource_hints( $urls, $relation_type ) {
203
-	if ( wp_style_is( 'twentythirteen-fonts', 'queue' ) && 'preconnect' === $relation_type ) {
204
-		if ( version_compare( $GLOBALS['wp_version'], '4.7-alpha', '>=' ) ) {
202
+function twentythirteen_resource_hints($urls, $relation_type) {
203
+	if (wp_style_is('twentythirteen-fonts', 'queue') && 'preconnect' === $relation_type) {
204
+		if (version_compare($GLOBALS['wp_version'], '4.7-alpha', '>=')) {
205 205
 			$urls[] = array(
206 206
 				'href' => 'https://fonts.gstatic.com',
207 207
 				'crossorigin',
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 
214 214
 	return $urls;
215 215
 }
216
-add_filter( 'wp_resource_hints', 'twentythirteen_resource_hints', 10, 2 );
216
+add_filter('wp_resource_hints', 'twentythirteen_resource_hints', 10, 2);
217 217
 
218 218
 /**
219 219
  * Filter the page title.
@@ -227,27 +227,27 @@  discard block
 block discarded – undo
227 227
  * @param string $sep   Optional separator.
228 228
  * @return string The filtered title.
229 229
  */
230
-function twentythirteen_wp_title( $title, $sep ) {
230
+function twentythirteen_wp_title($title, $sep) {
231 231
 	global $paged, $page;
232 232
 
233
-	if ( is_feed() )
233
+	if (is_feed())
234 234
 		return $title;
235 235
 
236 236
 	// Add the site name.
237
-	$title .= get_bloginfo( 'name', 'display' );
237
+	$title .= get_bloginfo('name', 'display');
238 238
 
239 239
 	// Add the site description for the home/front page.
240
-	$site_description = get_bloginfo( 'description', 'display' );
241
-	if ( $site_description && ( is_home() || is_front_page() ) )
240
+	$site_description = get_bloginfo('description', 'display');
241
+	if ($site_description && (is_home() || is_front_page()))
242 242
 		$title = "$title $sep $site_description";
243 243
 
244 244
 	// Add a page number if necessary.
245
-	if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() )
246
-		$title = "$title $sep " . sprintf( __( 'Page %s', 'twentythirteen' ), max( $paged, $page ) );
245
+	if (($paged >= 2 || $page >= 2) && ! is_404())
246
+		$title = "$title $sep ".sprintf(__('Page %s', 'twentythirteen'), max($paged, $page));
247 247
 
248 248
 	return $title;
249 249
 }
250
-add_filter( 'wp_title', 'twentythirteen_wp_title', 10, 2 );
250
+add_filter('wp_title', 'twentythirteen_wp_title', 10, 2);
251 251
 
252 252
 /**
253 253
  * Register two widget areas.
@@ -255,29 +255,29 @@  discard block
 block discarded – undo
255 255
  * @since Twenty Thirteen 1.0
256 256
  */
257 257
 function twentythirteen_widgets_init() {
258
-	register_sidebar( array(
259
-		'name'          => __( 'Main Widget Area', 'twentythirteen' ),
258
+	register_sidebar(array(
259
+		'name'          => __('Main Widget Area', 'twentythirteen'),
260 260
 		'id'            => 'sidebar-1',
261
-		'description'   => __( 'Appears in the footer section of the site.', 'twentythirteen' ),
261
+		'description'   => __('Appears in the footer section of the site.', 'twentythirteen'),
262 262
 		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
263 263
 		'after_widget'  => '</aside>',
264 264
 		'before_title'  => '<h3 class="widget-title">',
265 265
 		'after_title'   => '</h3>',
266
-	) );
266
+	));
267 267
 
268
-	register_sidebar( array(
269
-		'name'          => __( 'Secondary Widget Area', 'twentythirteen' ),
268
+	register_sidebar(array(
269
+		'name'          => __('Secondary Widget Area', 'twentythirteen'),
270 270
 		'id'            => 'sidebar-2',
271
-		'description'   => __( 'Appears on posts and pages in the sidebar.', 'twentythirteen' ),
271
+		'description'   => __('Appears on posts and pages in the sidebar.', 'twentythirteen'),
272 272
 		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
273 273
 		'after_widget'  => '</aside>',
274 274
 		'before_title'  => '<h3 class="widget-title">',
275 275
 		'after_title'   => '</h3>',
276
-	) );
276
+	));
277 277
 }
278
-add_action( 'widgets_init', 'twentythirteen_widgets_init' );
278
+add_action('widgets_init', 'twentythirteen_widgets_init');
279 279
 
280
-if ( ! function_exists( 'twentythirteen_paging_nav' ) ) :
280
+if ( ! function_exists('twentythirteen_paging_nav')) :
281 281
 /**
282 282
  * Display navigation to next/previous set of posts when applicable.
283 283
  *
@@ -287,19 +287,19 @@  discard block
 block discarded – undo
287 287
 	global $wp_query;
288 288
 
289 289
 	// Don't print empty markup if there's only one page.
290
-	if ( $wp_query->max_num_pages < 2 )
290
+	if ($wp_query->max_num_pages < 2)
291 291
 		return;
292 292
 	?>
293 293
 	<nav class="navigation paging-navigation" role="navigation">
294
-		<h1 class="screen-reader-text"><?php _e( 'Posts navigation', 'twentythirteen' ); ?></h1>
294
+		<h1 class="screen-reader-text"><?php _e('Posts navigation', 'twentythirteen'); ?></h1>
295 295
 		<div class="nav-links">
296 296
 
297
-			<?php if ( get_next_posts_link() ) : ?>
298
-			<div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'twentythirteen' ) ); ?></div>
297
+			<?php if (get_next_posts_link()) : ?>
298
+			<div class="nav-previous"><?php next_posts_link(__('<span class="meta-nav">&larr;</span> Older posts', 'twentythirteen')); ?></div>
299 299
 			<?php endif; ?>
300 300
 
301
-			<?php if ( get_previous_posts_link() ) : ?>
302
-			<div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentythirteen' ) ); ?></div>
301
+			<?php if (get_previous_posts_link()) : ?>
302
+			<div class="nav-next"><?php previous_posts_link(__('Newer posts <span class="meta-nav">&rarr;</span>', 'twentythirteen')); ?></div>
303 303
 			<?php endif; ?>
304 304
 
305 305
 		</div><!-- .nav-links -->
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
 }
309 309
 endif;
310 310
 
311
-if ( ! function_exists( 'twentythirteen_post_nav' ) ) :
311
+if ( ! function_exists('twentythirteen_post_nav')) :
312 312
 /**
313 313
  * Display navigation to next/previous post when applicable.
314 314
  *
@@ -318,18 +318,18 @@  discard block
 block discarded – undo
318 318
 	global $post;
319 319
 
320 320
 	// Don't print empty markup if there's nowhere to navigate.
321
-	$previous = ( is_attachment() ) ? get_post( $post->post_parent ) : get_adjacent_post( false, '', true );
322
-	$next     = get_adjacent_post( false, '', false );
321
+	$previous = (is_attachment()) ? get_post($post->post_parent) : get_adjacent_post(false, '', true);
322
+	$next     = get_adjacent_post(false, '', false);
323 323
 
324
-	if ( ! $next && ! $previous )
324
+	if ( ! $next && ! $previous)
325 325
 		return;
326 326
 	?>
327 327
 	<nav class="navigation post-navigation" role="navigation">
328
-		<h1 class="screen-reader-text"><?php _e( 'Post navigation', 'twentythirteen' ); ?></h1>
328
+		<h1 class="screen-reader-text"><?php _e('Post navigation', 'twentythirteen'); ?></h1>
329 329
 		<div class="nav-links">
330 330
 
331
-			<?php previous_post_link( '%link', _x( '<span class="meta-nav">&larr;</span> %title', 'Previous post link', 'twentythirteen' ) ); ?>
332
-			<?php next_post_link( '%link', _x( '%title <span class="meta-nav">&rarr;</span>', 'Next post link', 'twentythirteen' ) ); ?>
331
+			<?php previous_post_link('%link', _x('<span class="meta-nav">&larr;</span> %title', 'Previous post link', 'twentythirteen')); ?>
332
+			<?php next_post_link('%link', _x('%title <span class="meta-nav">&rarr;</span>', 'Next post link', 'twentythirteen')); ?>
333 333
 
334 334
 		</div><!-- .nav-links -->
335 335
 	</nav><!-- .navigation -->
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
 }
338 338
 endif;
339 339
 
340
-if ( ! function_exists( 'twentythirteen_entry_meta' ) ) :
340
+if ( ! function_exists('twentythirteen_entry_meta')) :
341 341
 /**
342 342
  * Print HTML with meta information for current post: categories, tags, permalink, author, and date.
343 343
  *
@@ -346,36 +346,36 @@  discard block
 block discarded – undo
346 346
  * @since Twenty Thirteen 1.0
347 347
  */
348 348
 function twentythirteen_entry_meta() {
349
-	if ( is_sticky() && is_home() && ! is_paged() )
350
-		echo '<span class="featured-post">' . esc_html__( 'Sticky', 'twentythirteen' ) . '</span>';
349
+	if (is_sticky() && is_home() && ! is_paged())
350
+		echo '<span class="featured-post">'.esc_html__('Sticky', 'twentythirteen').'</span>';
351 351
 
352
-	if ( ! has_post_format( 'link' ) && 'post' == get_post_type() )
352
+	if ( ! has_post_format('link') && 'post' == get_post_type())
353 353
 		twentythirteen_entry_date();
354 354
 
355 355
 	// Translators: used between list items, there is a space after the comma.
356
-	$categories_list = get_the_category_list( __( ', ', 'twentythirteen' ) );
357
-	if ( $categories_list ) {
358
-		echo '<span class="categories-links">' . $categories_list . '</span>';
356
+	$categories_list = get_the_category_list(__(', ', 'twentythirteen'));
357
+	if ($categories_list) {
358
+		echo '<span class="categories-links">'.$categories_list.'</span>';
359 359
 	}
360 360
 
361 361
 	// Translators: used between list items, there is a space after the comma.
362
-	$tag_list = get_the_tag_list( '', __( ', ', 'twentythirteen' ) );
363
-	if ( $tag_list ) {
364
-		echo '<span class="tags-links">' . $tag_list . '</span>';
362
+	$tag_list = get_the_tag_list('', __(', ', 'twentythirteen'));
363
+	if ($tag_list) {
364
+		echo '<span class="tags-links">'.$tag_list.'</span>';
365 365
 	}
366 366
 
367 367
 	// Post author
368
-	if ( 'post' == get_post_type() ) {
369
-		printf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a></span>',
370
-			esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
371
-			esc_attr( sprintf( __( 'View all posts by %s', 'twentythirteen' ), get_the_author() ) ),
368
+	if ('post' == get_post_type()) {
369
+		printf('<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a></span>',
370
+			esc_url(get_author_posts_url(get_the_author_meta('ID'))),
371
+			esc_attr(sprintf(__('View all posts by %s', 'twentythirteen'), get_the_author())),
372 372
 			get_the_author()
373 373
 		);
374 374
 	}
375 375
 }
376 376
 endif;
377 377
 
378
-if ( ! function_exists( 'twentythirteen_entry_date' ) ) :
378
+if ( ! function_exists('twentythirteen_entry_date')) :
379 379
 /**
380 380
  * Print HTML with date information for current post.
381 381
  *
@@ -386,27 +386,27 @@  discard block
 block discarded – undo
386 386
  * @param boolean $echo (optional) Whether to echo the date. Default true.
387 387
  * @return string The HTML-formatted post date.
388 388
  */
389
-function twentythirteen_entry_date( $echo = true ) {
390
-	if ( has_post_format( array( 'chat', 'status' ) ) )
391
-		$format_prefix = _x( '%1$s on %2$s', '1: post format name. 2: date', 'twentythirteen' );
389
+function twentythirteen_entry_date($echo = true) {
390
+	if (has_post_format(array('chat', 'status')))
391
+		$format_prefix = _x('%1$s on %2$s', '1: post format name. 2: date', 'twentythirteen');
392 392
 	else
393 393
 		$format_prefix = '%2$s';
394 394
 
395
-	$date = sprintf( '<span class="date"><a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a></span>',
396
-		esc_url( get_permalink() ),
397
-		esc_attr( sprintf( __( 'Permalink to %s', 'twentythirteen' ), the_title_attribute( 'echo=0' ) ) ),
398
-		esc_attr( get_the_date( 'c' ) ),
399
-		esc_html( sprintf( $format_prefix, get_post_format_string( get_post_format() ), get_the_date() ) )
395
+	$date = sprintf('<span class="date"><a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a></span>',
396
+		esc_url(get_permalink()),
397
+		esc_attr(sprintf(__('Permalink to %s', 'twentythirteen'), the_title_attribute('echo=0'))),
398
+		esc_attr(get_the_date('c')),
399
+		esc_html(sprintf($format_prefix, get_post_format_string(get_post_format()), get_the_date()))
400 400
 	);
401 401
 
402
-	if ( $echo )
402
+	if ($echo)
403 403
 		echo $date;
404 404
 
405 405
 	return $date;
406 406
 }
407 407
 endif;
408 408
 
409
-if ( ! function_exists( 'twentythirteen_the_attached_image' ) ) :
409
+if ( ! function_exists('twentythirteen_the_attached_image')) :
410 410
 /**
411 411
  * Print the attached image with a link to the next attached image.
412 412
  *
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
 	 *     @type int The attachment width in pixels.
424 424
 	 * }
425 425
 	 */
426
-	$attachment_size     = apply_filters( 'twentythirteen_attachment_size', array( 724, 724 ) );
426
+	$attachment_size     = apply_filters('twentythirteen_attachment_size', array(724, 724));
427 427
 	$next_attachment_url = wp_get_attachment_url();
428 428
 	$post                = get_post();
429 429
 
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
 	 * looking at the last image in a gallery), or, in a gallery of one, just the
434 434
 	 * link to that image file.
435 435
 	 */
436
-	$attachment_ids = get_posts( array(
436
+	$attachment_ids = get_posts(array(
437 437
 		'post_parent'    => $post->post_parent,
438 438
 		'fields'         => 'ids',
439 439
 		'numberposts'    => -1,
@@ -442,30 +442,30 @@  discard block
 block discarded – undo
442 442
 		'post_mime_type' => 'image',
443 443
 		'order'          => 'ASC',
444 444
 		'orderby'        => 'menu_order ID',
445
-	) );
445
+	));
446 446
 
447 447
 	// If there is more than 1 attachment in a gallery...
448
-	if ( count( $attachment_ids ) > 1 ) {
449
-		foreach ( $attachment_ids as $idx => $attachment_id ) {
450
-			if ( $attachment_id == $post->ID ) {
451
-				$next_id = $attachment_ids[ ( $idx + 1 ) % count( $attachment_ids ) ];
448
+	if (count($attachment_ids) > 1) {
449
+		foreach ($attachment_ids as $idx => $attachment_id) {
450
+			if ($attachment_id == $post->ID) {
451
+				$next_id = $attachment_ids[($idx + 1) % count($attachment_ids)];
452 452
 				break;
453 453
 			}
454 454
 		}
455 455
 
456 456
 		// get the URL of the next image attachment...
457
-		if ( $next_id )
458
-			$next_attachment_url = get_attachment_link( $next_id );
457
+		if ($next_id)
458
+			$next_attachment_url = get_attachment_link($next_id);
459 459
 
460 460
 		// or get the URL of the first image attachment.
461 461
 		else
462
-			$next_attachment_url = get_attachment_link( reset( $attachment_ids ) );
462
+			$next_attachment_url = get_attachment_link(reset($attachment_ids));
463 463
 	}
464 464
 
465
-	printf( '<a href="%1$s" title="%2$s" rel="attachment">%3$s</a>',
466
-		esc_url( $next_attachment_url ),
467
-		the_title_attribute( array( 'echo' => false ) ),
468
-		wp_get_attachment_image( $post->ID, $attachment_size )
465
+	printf('<a href="%1$s" title="%2$s" rel="attachment">%3$s</a>',
466
+		esc_url($next_attachment_url),
467
+		the_title_attribute(array('echo' => false)),
468
+		wp_get_attachment_image($post->ID, $attachment_size)
469 469
 	);
470 470
 }
471 471
 endif;
@@ -484,12 +484,12 @@  discard block
 block discarded – undo
484 484
  */
485 485
 function twentythirteen_get_link_url() {
486 486
 	$content = get_the_content();
487
-	$has_url = get_url_in_content( $content );
487
+	$has_url = get_url_in_content($content);
488 488
 
489
-	return ( $has_url ) ? $has_url : apply_filters( 'the_permalink', get_permalink() );
489
+	return ($has_url) ? $has_url : apply_filters('the_permalink', get_permalink());
490 490
 }
491 491
 
492
-if ( ! function_exists( 'twentythirteen_excerpt_more' ) && ! is_admin() ) :
492
+if ( ! function_exists('twentythirteen_excerpt_more') && ! is_admin()) :
493 493
 /**
494 494
  * Replaces "[...]" (appended to automatically generated excerpts) with ...
495 495
  * and a Continue reading link.
@@ -499,15 +499,15 @@  discard block
 block discarded – undo
499 499
  * @param string $more Default Read More excerpt link.
500 500
  * @return string Filtered Read More excerpt link.
501 501
  */
502
-function twentythirteen_excerpt_more( $more ) {
503
-	$link = sprintf( '<a href="%1$s" class="more-link">%2$s</a>',
504
-		esc_url( get_permalink( get_the_ID() ) ),
502
+function twentythirteen_excerpt_more($more) {
503
+	$link = sprintf('<a href="%1$s" class="more-link">%2$s</a>',
504
+		esc_url(get_permalink(get_the_ID())),
505 505
 			/* translators: %s: Name of current post */
506
-			sprintf( __( 'Continue reading %s <span class="meta-nav">&rarr;</span>', 'twentythirteen' ), '<span class="screen-reader-text">' . get_the_title( get_the_ID() ) . '</span>' )
506
+			sprintf(__('Continue reading %s <span class="meta-nav">&rarr;</span>', 'twentythirteen'), '<span class="screen-reader-text">'.get_the_title(get_the_ID()).'</span>')
507 507
 		);
508
-	return ' &hellip; ' . $link;
508
+	return ' &hellip; '.$link;
509 509
 }
510
-add_filter( 'excerpt_more', 'twentythirteen_excerpt_more' );
510
+add_filter('excerpt_more', 'twentythirteen_excerpt_more');
511 511
 endif;
512 512
 
513 513
 /**
@@ -523,19 +523,19 @@  discard block
 block discarded – undo
523 523
  * @param array $classes A list of existing body class values.
524 524
  * @return array The filtered body class list.
525 525
  */
526
-function twentythirteen_body_class( $classes ) {
527
-	if ( ! is_multi_author() )
526
+function twentythirteen_body_class($classes) {
527
+	if ( ! is_multi_author())
528 528
 		$classes[] = 'single-author';
529 529
 
530
-	if ( is_active_sidebar( 'sidebar-2' ) && ! is_attachment() && ! is_404() )
530
+	if (is_active_sidebar('sidebar-2') && ! is_attachment() && ! is_404())
531 531
 		$classes[] = 'sidebar';
532 532
 
533
-	if ( ! get_option( 'show_avatars' ) )
533
+	if ( ! get_option('show_avatars'))
534 534
 		$classes[] = 'no-avatars';
535 535
 
536 536
 	return $classes;
537 537
 }
538
-add_filter( 'body_class', 'twentythirteen_body_class' );
538
+add_filter('body_class', 'twentythirteen_body_class');
539 539
 
540 540
 /**
541 541
  * Adjust content_width value for video post formats and attachment templates.
@@ -545,12 +545,12 @@  discard block
 block discarded – undo
545 545
 function twentythirteen_content_width() {
546 546
 	global $content_width;
547 547
 
548
-	if ( is_attachment() )
548
+	if (is_attachment())
549 549
 		$content_width = 724;
550
-	elseif ( has_post_format( 'audio' ) )
550
+	elseif (has_post_format('audio'))
551 551
 		$content_width = 484;
552 552
 }
553
-add_action( 'template_redirect', 'twentythirteen_content_width' );
553
+add_action('template_redirect', 'twentythirteen_content_width');
554 554
 
555 555
 /**
556 556
  * Add postMessage support for site title and description for the Customizer.
@@ -559,25 +559,25 @@  discard block
 block discarded – undo
559 559
  *
560 560
  * @param WP_Customize_Manager $wp_customize Customizer object.
561 561
  */
562
-function twentythirteen_customize_register( $wp_customize ) {
563
-	$wp_customize->get_setting( 'blogname' )->transport         = 'postMessage';
564
-	$wp_customize->get_setting( 'blogdescription' )->transport  = 'postMessage';
565
-	$wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';
562
+function twentythirteen_customize_register($wp_customize) {
563
+	$wp_customize->get_setting('blogname')->transport         = 'postMessage';
564
+	$wp_customize->get_setting('blogdescription')->transport  = 'postMessage';
565
+	$wp_customize->get_setting('header_textcolor')->transport = 'postMessage';
566 566
 
567
-	if ( isset( $wp_customize->selective_refresh ) ) {
568
-		$wp_customize->selective_refresh->add_partial( 'blogname', array(
567
+	if (isset($wp_customize->selective_refresh)) {
568
+		$wp_customize->selective_refresh->add_partial('blogname', array(
569 569
 			'selector' => '.site-title',
570 570
 			'container_inclusive' => false,
571 571
 			'render_callback' => 'twentythirteen_customize_partial_blogname',
572
-		) );
573
-		$wp_customize->selective_refresh->add_partial( 'blogdescription', array(
572
+		));
573
+		$wp_customize->selective_refresh->add_partial('blogdescription', array(
574 574
 			'selector' => '.site-description',
575 575
 			'container_inclusive' => false,
576 576
 			'render_callback' => 'twentythirteen_customize_partial_blogdescription',
577
-		) );
577
+		));
578 578
 	}
579 579
 }
580
-add_action( 'customize_register', 'twentythirteen_customize_register' );
580
+add_action('customize_register', 'twentythirteen_customize_register');
581 581
 
582 582
 /**
583 583
  * Render the site title for the selective refresh partial.
@@ -588,7 +588,7 @@  discard block
 block discarded – undo
588 588
  * @return void
589 589
  */
590 590
 function twentythirteen_customize_partial_blogname() {
591
-	bloginfo( 'name' );
591
+	bloginfo('name');
592 592
 }
593 593
 
594 594
 /**
@@ -600,7 +600,7 @@  discard block
 block discarded – undo
600 600
  * @return void
601 601
  */
602 602
 function twentythirteen_customize_partial_blogdescription() {
603
-	bloginfo( 'description' );
603
+	bloginfo('description');
604 604
 }
605 605
 
606 606
 /**
@@ -612,6 +612,6 @@  discard block
 block discarded – undo
612 612
  * @since Twenty Thirteen 1.0
613 613
  */
614 614
 function twentythirteen_customize_preview_js() {
615
-	wp_enqueue_script( 'twentythirteen-customizer', get_template_directory_uri() . '/js/theme-customizer.js', array( 'customize-preview' ), '20141120', true );
615
+	wp_enqueue_script('twentythirteen-customizer', get_template_directory_uri().'/js/theme-customizer.js', array('customize-preview'), '20141120', true);
616 616
 }
617
-add_action( 'customize_preview_init', 'twentythirteen_customize_preview_js' );
617
+add_action('customize_preview_init', 'twentythirteen_customize_preview_js');
Please login to merge, or discard this patch.
Braces   +66 added lines, -45 removed lines patch added patch discarded remove patch
@@ -28,8 +28,9 @@  discard block
 block discarded – undo
28 28
  *
29 29
  * @see twentythirteen_content_width() for template-specific adjustments.
30 30
  */
31
-if ( ! isset( $content_width ) )
31
+if ( ! isset( $content_width ) ) {
32 32
 	$content_width = 604;
33
+}
33 34
 
34 35
 /**
35 36
  * Add support for a custom header image.
@@ -39,8 +40,9 @@  discard block
 block discarded – undo
39 40
 /**
40 41
  * Twenty Thirteen only works in WordPress 3.6 or later.
41 42
  */
42
-if ( version_compare( $GLOBALS['wp_version'], '3.6-alpha', '<' ) )
43
+if ( version_compare( $GLOBALS['wp_version'], '3.6-alpha', '<' ) ) {
43 44
 	require get_template_directory() . '/inc/back-compat.php';
45
+}
44 46
 
45 47
 /**
46 48
  * Twenty Thirteen setup.
@@ -139,11 +141,13 @@  discard block
 block discarded – undo
139 141
 	if ( 'off' !== $source_sans_pro || 'off' !== $bitter ) {
140 142
 		$font_families = array();
141 143
 
142
-		if ( 'off' !== $source_sans_pro )
143
-			$font_families[] = 'Source Sans Pro:300,400,700,300italic,400italic,700italic';
144
+		if ( 'off' !== $source_sans_pro ) {
145
+					$font_families[] = 'Source Sans Pro:300,400,700,300italic,400italic,700italic';
146
+		}
144 147
 
145
-		if ( 'off' !== $bitter )
146
-			$font_families[] = 'Bitter:400,700';
148
+		if ( 'off' !== $bitter ) {
149
+					$font_families[] = 'Bitter:400,700';
150
+		}
147 151
 
148 152
 		$query_args = array(
149 153
 			'family' => urlencode( implode( '|', $font_families ) ),
@@ -165,12 +169,14 @@  discard block
 block discarded – undo
165 169
 	 * Adds JavaScript to pages with the comment form to support
166 170
 	 * sites with threaded comments (when in use).
167 171
 	 */
168
-	if ( is_singular() && comments_open() && get_option( 'thread_comments' ) )
169
-		wp_enqueue_script( 'comment-reply' );
172
+	if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
173
+			wp_enqueue_script( 'comment-reply' );
174
+	}
170 175
 
171 176
 	// Adds Masonry to handle vertical alignment of footer widgets.
172
-	if ( is_active_sidebar( 'sidebar-1' ) )
173
-		wp_enqueue_script( 'jquery-masonry' );
177
+	if ( is_active_sidebar( 'sidebar-1' ) ) {
178
+			wp_enqueue_script( 'jquery-masonry' );
179
+	}
174 180
 
175 181
 	// Loads JavaScript file with functionality specific to Twenty Thirteen.
176 182
 	wp_enqueue_script( 'twentythirteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20160717', true );
@@ -230,20 +236,23 @@  discard block
 block discarded – undo
230 236
 function twentythirteen_wp_title( $title, $sep ) {
231 237
 	global $paged, $page;
232 238
 
233
-	if ( is_feed() )
234
-		return $title;
239
+	if ( is_feed() ) {
240
+			return $title;
241
+	}
235 242
 
236 243
 	// Add the site name.
237 244
 	$title .= get_bloginfo( 'name', 'display' );
238 245
 
239 246
 	// Add the site description for the home/front page.
240 247
 	$site_description = get_bloginfo( 'description', 'display' );
241
-	if ( $site_description && ( is_home() || is_front_page() ) )
242
-		$title = "$title $sep $site_description";
248
+	if ( $site_description && ( is_home() || is_front_page() ) ) {
249
+			$title = "$title $sep $site_description";
250
+	}
243 251
 
244 252
 	// Add a page number if necessary.
245
-	if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() )
246
-		$title = "$title $sep " . sprintf( __( 'Page %s', 'twentythirteen' ), max( $paged, $page ) );
253
+	if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) {
254
+			$title = "$title $sep " . sprintf( __( 'Page %s', 'twentythirteen' ), max( $paged, $page ) );
255
+	}
247 256
 
248 257
 	return $title;
249 258
 }
@@ -287,8 +296,9 @@  discard block
 block discarded – undo
287 296
 	global $wp_query;
288 297
 
289 298
 	// Don't print empty markup if there's only one page.
290
-	if ( $wp_query->max_num_pages < 2 )
291
-		return;
299
+	if ( $wp_query->max_num_pages < 2 ) {
300
+			return;
301
+	}
292 302
 	?>
293 303
 	<nav class="navigation paging-navigation" role="navigation">
294 304
 		<h1 class="screen-reader-text"><?php _e( 'Posts navigation', 'twentythirteen' ); ?></h1>
@@ -321,8 +331,9 @@  discard block
 block discarded – undo
321 331
 	$previous = ( is_attachment() ) ? get_post( $post->post_parent ) : get_adjacent_post( false, '', true );
322 332
 	$next     = get_adjacent_post( false, '', false );
323 333
 
324
-	if ( ! $next && ! $previous )
325
-		return;
334
+	if ( ! $next && ! $previous ) {
335
+			return;
336
+	}
326 337
 	?>
327 338
 	<nav class="navigation post-navigation" role="navigation">
328 339
 		<h1 class="screen-reader-text"><?php _e( 'Post navigation', 'twentythirteen' ); ?></h1>
@@ -346,11 +357,13 @@  discard block
 block discarded – undo
346 357
  * @since Twenty Thirteen 1.0
347 358
  */
348 359
 function twentythirteen_entry_meta() {
349
-	if ( is_sticky() && is_home() && ! is_paged() )
350
-		echo '<span class="featured-post">' . esc_html__( 'Sticky', 'twentythirteen' ) . '</span>';
360
+	if ( is_sticky() && is_home() && ! is_paged() ) {
361
+			echo '<span class="featured-post">' . esc_html__( 'Sticky', 'twentythirteen' ) . '</span>';
362
+	}
351 363
 
352
-	if ( ! has_post_format( 'link' ) && 'post' == get_post_type() )
353
-		twentythirteen_entry_date();
364
+	if ( ! has_post_format( 'link' ) && 'post' == get_post_type() ) {
365
+			twentythirteen_entry_date();
366
+	}
354 367
 
355 368
 	// Translators: used between list items, there is a space after the comma.
356 369
 	$categories_list = get_the_category_list( __( ', ', 'twentythirteen' ) );
@@ -387,10 +400,11 @@  discard block
 block discarded – undo
387 400
  * @return string The HTML-formatted post date.
388 401
  */
389 402
 function twentythirteen_entry_date( $echo = true ) {
390
-	if ( has_post_format( array( 'chat', 'status' ) ) )
391
-		$format_prefix = _x( '%1$s on %2$s', '1: post format name. 2: date', 'twentythirteen' );
392
-	else
393
-		$format_prefix = '%2$s';
403
+	if ( has_post_format( array( 'chat', 'status' ) ) ) {
404
+			$format_prefix = _x( '%1$s on %2$s', '1: post format name. 2: date', 'twentythirteen' );
405
+	} else {
406
+			$format_prefix = '%2$s';
407
+	}
394 408
 
395 409
 	$date = sprintf( '<span class="date"><a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a></span>',
396 410
 		esc_url( get_permalink() ),
@@ -399,8 +413,9 @@  discard block
 block discarded – undo
399 413
 		esc_html( sprintf( $format_prefix, get_post_format_string( get_post_format() ), get_the_date() ) )
400 414
 	);
401 415
 
402
-	if ( $echo )
403
-		echo $date;
416
+	if ( $echo ) {
417
+			echo $date;
418
+	}
404 419
 
405 420
 	return $date;
406 421
 }
@@ -454,12 +469,14 @@  discard block
 block discarded – undo
454 469
 		}
455 470
 
456 471
 		// get the URL of the next image attachment...
457
-		if ( $next_id )
458
-			$next_attachment_url = get_attachment_link( $next_id );
472
+		if ( $next_id ) {
473
+					$next_attachment_url = get_attachment_link( $next_id );
474
+		}
459 475
 
460 476
 		// or get the URL of the first image attachment.
461
-		else
462
-			$next_attachment_url = get_attachment_link( reset( $attachment_ids ) );
477
+		else {
478
+					$next_attachment_url = get_attachment_link( reset( $attachment_ids ) );
479
+		}
463 480
 	}
464 481
 
465 482
 	printf( '<a href="%1$s" title="%2$s" rel="attachment">%3$s</a>',
@@ -524,14 +541,17 @@  discard block
 block discarded – undo
524 541
  * @return array The filtered body class list.
525 542
  */
526 543
 function twentythirteen_body_class( $classes ) {
527
-	if ( ! is_multi_author() )
528
-		$classes[] = 'single-author';
544
+	if ( ! is_multi_author() ) {
545
+			$classes[] = 'single-author';
546
+	}
529 547
 
530
-	if ( is_active_sidebar( 'sidebar-2' ) && ! is_attachment() && ! is_404() )
531
-		$classes[] = 'sidebar';
548
+	if ( is_active_sidebar( 'sidebar-2' ) && ! is_attachment() && ! is_404() ) {
549
+			$classes[] = 'sidebar';
550
+	}
532 551
 
533
-	if ( ! get_option( 'show_avatars' ) )
534
-		$classes[] = 'no-avatars';
552
+	if ( ! get_option( 'show_avatars' ) ) {
553
+			$classes[] = 'no-avatars';
554
+	}
535 555
 
536 556
 	return $classes;
537 557
 }
@@ -545,11 +565,12 @@  discard block
 block discarded – undo
545 565
 function twentythirteen_content_width() {
546 566
 	global $content_width;
547 567
 
548
-	if ( is_attachment() )
549
-		$content_width = 724;
550
-	elseif ( has_post_format( 'audio' ) )
551
-		$content_width = 484;
552
-}
568
+	if ( is_attachment() ) {
569
+			$content_width = 724;
570
+	} elseif ( has_post_format( 'audio' ) ) {
571
+			$content_width = 484;
572
+	}
573
+	}
553 574
 add_action( 'template_redirect', 'twentythirteen_content_width' );
554 575
 
555 576
 /**
Please login to merge, or discard this patch.