mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-12-06 12:51:58 +00:00
Introduce a single function for getting all the intermediate image sizes to be used both when adding attachements and deleting. Fixes #10263 props scribu.
git-svn-id: https://develop.svn.wordpress.org/trunk@12659 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -506,6 +506,20 @@ function image_get_intermediate_size($post_id, $size='thumbnail') {
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the available image sizes
|
||||
* @since 3.0
|
||||
* @return array Returns a filtered array of image size strings
|
||||
*/
|
||||
function get_intermediate_image_sizes() {
|
||||
global $_wp_additional_image_sizes;
|
||||
$image_sizes = array('thumbnail', 'medium', 'large'); // Standard sizes
|
||||
if ( isset( $_wp_additional_image_sizes ) && count( $_wp_additional_image_sizes ) )
|
||||
$image_sizes = array_merge( $image_sizes, array_keys( $_wp_additional_image_sizes ) );
|
||||
|
||||
return apply_filters( 'intermediate_image_sizes', $image_sizes );
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve an image to represent an attachment.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user