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

@@ -700,13 +700,11 @@ function wp_restore_image($post_id) {
* Saves image to post along with enqueued changes
* in $_REQUEST['history']
*
* @global array $_wp_additional_image_sizes
*
* @param int $post_id
* @return \stdClass
*/
function wp_save_image( $post_id ) {
global $_wp_additional_image_sizes;
$_wp_additional_image_sizes = wp_get_additional_image_sizes();
$return = new stdClass;
$success = $delete = $scaled = $nocrop = false;