mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-07 09:49:04 +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:
@@ -102,13 +102,8 @@ function wp_generate_attachment_metadata( $attachment_id, $file ) {
|
||||
|
||||
// make thumbnails and other intermediate sizes
|
||||
global $_wp_additional_image_sizes;
|
||||
$temp_sizes = array('thumbnail', 'medium', 'large'); // Standard sizes
|
||||
if ( isset( $_wp_additional_image_sizes ) && count( $_wp_additional_image_sizes ) )
|
||||
$temp_sizes = array_merge( $temp_sizes, array_keys( $_wp_additional_image_sizes ) );
|
||||
|
||||
$temp_sizes = apply_filters( 'intermediate_image_sizes', $temp_sizes );
|
||||
|
||||
foreach ( $temp_sizes as $s ) {
|
||||
foreach ( get_intermediate_image_sizes() as $s ) {
|
||||
$sizes[$s] = array( 'width' => '', 'height' => '', 'crop' => FALSE );
|
||||
if ( isset( $_wp_additional_image_sizes[$s]['width'] ) )
|
||||
$sizes[$s]['width'] = intval( $_wp_additional_image_sizes[$s]['width'] ); // For theme-added sizes
|
||||
|
||||
Reference in New Issue
Block a user