Make WordPress Core

Changeset 35023


Ignore:
Timestamp:
10/11/2015 05:09:33 PM (9 years ago)
Author:
DrewAPicture
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/post.php

    r35022 r35023  
    13951395
    13961396    if ( $thumbnail_id && get_post( $thumbnail_id ) ) {
    1397         $old_content_width = $content_width;
    1398         $content_width = 266;
    1399 
    1400         $size = isset( $_wp_additional_image_sizes['post-thumbnail'] ) ? 'post-thumbnail' : array( $content_width, $content_width );
     1397        $size = isset( $_wp_additional_image_sizes['post-thumbnail'] ) ? 'post-thumbnail' : array( 266, 266 );
    14011398
    14021399        /**
     
    14101407         * @since 4.4.0
    14111408         *
    1412          * @param string|array $size         Post thumbnail image size to display in the meta box. Accepts
    1413          *                                   any valid image size, or an array of height and width values.
    1414          *                                   If the 'post-thumbnail' size is set, default is 'post-thumbnail'.
    1415          *                                   Otherwise, default is an array with `$content_width` as the
    1416          *                                   height and width values.
     1409         * @param string|array $size         Post thumbnail image size to display in the meta box. Accepts any valid
     1410         *                                   image size, or an array of height and width values in pixels. If the
     1411         *                                   'post-thumbnail' size is set, default is 'post-thumbnail'. Otherwise,
     1412         *                                   default is an array with 266 as both the height and width values.
    14171413         * @param int          $thumbnail_id Post thumbnail attachment ID.
    14181414         * @param WP_Post      $post         The post object associated with the thumbnail.
     
    14311427            $content .= '<p class="hide-if-no-js"><a href="#" id="remove-post-thumbnail" onclick="WPRemoveThumbnail(\'' . $ajax_nonce . '\');return false;">' . esc_html( $post_type_object->labels->remove_featured_image ) . '</a></p>';
    14321428        }
    1433         $content_width = $old_content_width;
    14341429    }
    14351430
Note: See TracChangeset for help on using the changeset viewer.