Ticket #10263: get_intermediate_sizes.2.patch
File get_intermediate_sizes.2.patch, 2.4 KB (added by , 15 years ago) |
---|
-
wp-includes/post.php
2899 2899 } 2900 2900 2901 2901 // remove intermediate and backup images if there are any 2902 $sizes = apply_filters('intermediate_image_sizes', array('thumbnail', 'medium', 'large')); 2903 foreach ( $sizes as $size ) { 2902 foreach ( get_intermediate_image_sizes() as $size ) { 2904 2903 if ( $intermediate = image_get_intermediate_size($post_id, $size) ) { 2905 2904 $intermediate_file = apply_filters('wp_delete_file', $intermediate['path']); 2906 2905 @ unlink( path_join($uploadpath['basedir'], $intermediate_file) ); -
wp-includes/media.php
507 507 } 508 508 509 509 /** 510 * Get the available image sizes 511 * @since 3.0 512 * @return array Returns a filtered array of image size strings 513 */ 514 function get_intermediate_image_sizes() { 515 global $_wp_additional_image_sizes; 516 $image_sizes = array('thumbnail', 'medium', 'large'); // Standard sizes 517 if ( isset( $_wp_additional_image_sizes ) && count( $_wp_additional_image_sizes ) ) 518 $image_sizes = array_merge( $image_sizes, array_keys( $_wp_additional_image_sizes ) ); 519 520 return apply_filters( 'intermediate_image_sizes', $image_sizes ); 521 } 522 523 /** 510 524 * Retrieve an image to represent an attachment. 511 525 * 512 526 * A mime icon for files, thumbnail or intermediate size for images. -
wp-admin/includes/image.php
102 102 103 103 // make thumbnails and other intermediate sizes 104 104 global $_wp_additional_image_sizes; 105 $temp_sizes = array('thumbnail', 'medium', 'large'); // Standard sizes106 if ( isset( $_wp_additional_image_sizes ) && count( $_wp_additional_image_sizes ) )107 $temp_sizes = array_merge( $temp_sizes, array_keys( $_wp_additional_image_sizes ) );108 105 109 $temp_sizes = apply_filters( 'intermediate_image_sizes', $temp_sizes ); 110 111 foreach ( $temp_sizes as $s ) { 106 foreach ( get_intermediate_image_sizes() as $s ) { 112 107 $sizes[$s] = array( 'width' => '', 'height' => '', 'crop' => FALSE ); 113 108 if ( isset( $_wp_additional_image_sizes[$s]['width'] ) ) 114 109 $sizes[$s]['width'] = intval( $_wp_additional_image_sizes[$s]['width'] ); // For theme-added sizes