Media: add a function, wp_get_additional_image_sizes(), that wraps the retrieval of the global $_wp_additional_image_sizes. Removes 6 global imports.

See #37699.


git-svn-id: https://develop.svn.wordpress.org/trunk@38303 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor
2016-08-22 04:36:42 +00:00
parent e878e8156b
commit 45cd115bf6
4 changed files with 56 additions and 35 deletions

View File

@@ -1367,14 +1367,12 @@ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) {
*
* @since 2.9.0
*
* @global array $_wp_additional_image_sizes
*
* @param int $thumbnail_id ID of the attachment used for thumbnail
* @param mixed $post The post ID or object associated with the thumbnail, defaults to global $post.
* @return string html
*/
function _wp_post_thumbnail_html( $thumbnail_id = null, $post = null ) {
global $_wp_additional_image_sizes;
$_wp_additional_image_sizes = wp_get_additional_image_sizes();
$post = get_post( $post );
$post_type_object = get_post_type_object( $post->post_type );