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:
Peter Westwood
2010-01-08 08:51:12 +00:00
parent b2360778ee
commit b5a43efa73
3 changed files with 16 additions and 8 deletions
+1 -6
View File
@@ -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