From 8cfe23313779ccb9fa50aa748fa867a2d68ffa4e Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 8 Sep 2017 06:04:44 +0000 Subject: [PATCH] =?UTF-8?q?Twenty=20Sixteen:=20Replace=20inline=20control?= =?UTF-8?q?=20structure=D0=B2=20to=20improve=20code=20readability.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #38468. Built from https://develop.svn.wordpress.org/trunk@41343 git-svn-id: http://core.svn.wordpress.org/trunk@41176 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-content/themes/twentysixteen/functions.php | 22 ++++++++++++++----- wp-includes/version.php | 2 +- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/wp-content/themes/twentysixteen/functions.php b/wp-content/themes/twentysixteen/functions.php index 4d305c6ecd..75855f805e 100644 --- a/wp-content/themes/twentysixteen/functions.php +++ b/wp-content/themes/twentysixteen/functions.php @@ -371,13 +371,20 @@ require get_template_directory() . '/inc/customizer.php'; function twentysixteen_content_image_sizes_attr( $sizes, $size ) { $width = $size[0]; - 840 <= $width && $sizes = '(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px'; + if ( 840 <= $width ){ + $sizes = '(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px'; + } if ( 'page' === get_post_type() ) { - 840 > $width && $sizes = '(max-width: ' . $width . 'px) 85vw, ' . $width . 'px'; + if ( 840 > $width ) { + $sizes = '(max-width: ' . $width . 'px) 85vw, ' . $width . 'px'; + } } else { - 840 > $width && 600 <= $width && $sizes = '(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px'; - 600 > $width && $sizes = '(max-width: ' . $width . 'px) 85vw, ' . $width . 'px'; + if ( 840 > $width && 600 <= $width ) { + $sizes = '(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px'; + } elseif ( 600 > $width ) { + $sizes = '(max-width: ' . $width . 'px) 85vw, ' . $width . 'px'; + } } return $sizes; @@ -397,8 +404,11 @@ add_filter( 'wp_calculate_image_sizes', 'twentysixteen_content_image_sizes_attr' */ function twentysixteen_post_thumbnail_sizes_attr( $attr, $attachment, $size ) { if ( 'post-thumbnail' === $size ) { - is_active_sidebar( 'sidebar-1' ) && $attr['sizes'] = '(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 60vw, (max-width: 1362px) 62vw, 840px'; - ! is_active_sidebar( 'sidebar-1' ) && $attr['sizes'] = '(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 88vw, 1200px'; + if ( is_active_sidebar( 'sidebar-1' ) ) { + $attr['sizes'] = '(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 60vw, (max-width: 1362px) 62vw, 840px'; + } else { + $attr['sizes'] = '(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 88vw, 1200px'; + } } return $attr; } diff --git a/wp-includes/version.php b/wp-includes/version.php index 9e80c7a5b9..686d327731 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.9-alpha-41342'; +$wp_version = '4.9-alpha-41343'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.