From 2c6e416159bbfffb0b1555afbf591c5976bcc880 Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Sun, 11 Oct 2015 17:10:25 +0000 Subject: [PATCH] Media: Remove logic for unnecessarily overloading the `$content_width` global when passing default dimensions used to display the post thumbnail image in the 'Featured Image' meta box. Updates documentation for the `$size` parameter in `admin_post_thumbnail_size` filter doc. See #28512. Built from https://develop.svn.wordpress.org/trunk@35023 git-svn-id: http://core.svn.wordpress.org/trunk@34988 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/post.php | 15 +++++---------- wp-includes/version.php | 2 +- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index f5f6234994..1755509ca0 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -1394,10 +1394,7 @@ function _wp_post_thumbnail_html( $thumbnail_id = null, $post = null ) { ); if ( $thumbnail_id && get_post( $thumbnail_id ) ) { - $old_content_width = $content_width; - $content_width = 266; - - $size = isset( $_wp_additional_image_sizes['post-thumbnail'] ) ? 'post-thumbnail' : array( $content_width, $content_width ); + $size = isset( $_wp_additional_image_sizes['post-thumbnail'] ) ? 'post-thumbnail' : array( 266, 266 ); /** * Filter the size used to display the post thumbnail image in the 'Featured Image' meta box. @@ -1409,11 +1406,10 @@ function _wp_post_thumbnail_html( $thumbnail_id = null, $post = null ) { * * @since 4.4.0 * - * @param string|array $size Post thumbnail image size to display in the meta box. Accepts - * any valid image size, or an array of height and width values. - * If the 'post-thumbnail' size is set, default is 'post-thumbnail'. - * Otherwise, default is an array with `$content_width` as the - * height and width values. + * @param string|array $size Post thumbnail image size to display in the meta box. Accepts any valid + * image size, or an array of height and width values in pixels. If the + * 'post-thumbnail' size is set, default is 'post-thumbnail'. Otherwise, + * default is an array with 266 as both the height and width values. * @param int $thumbnail_id Post thumbnail attachment ID. * @param WP_Post $post The post object associated with the thumbnail. */ @@ -1430,7 +1426,6 @@ function _wp_post_thumbnail_html( $thumbnail_id = null, $post = null ) { ); $content .= '

' . esc_html( $post_type_object->labels->remove_featured_image ) . '

'; } - $content_width = $old_content_width; } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index 59e59e31c1..b0e84edf46 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-35022'; +$wp_version = '4.4-alpha-35023'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.