Ticket #18947: 18947.patch
File 18947.patch, 2.2 KB (added by , 13 years ago) |
---|
-
wp-admin/includes/image.php
103 103 // make thumbnails and other intermediate sizes 104 104 global $_wp_additional_image_sizes; 105 105 106 foreach ( get_intermediate_image_sizes() as $s ) {106 foreach ( array_keys( get_intermediate_image_sizes() ) as $s ) { 107 107 $sizes[$s] = array( 'width' => '', 'height' => '', 'crop' => FALSE ); 108 108 if ( isset( $_wp_additional_image_sizes[$s]['width'] ) ) 109 109 $sizes[$s]['width'] = intval( $_wp_additional_image_sizes[$s]['width'] ); // For theme-added sizes -
wp-includes/media.php
583 583 */ 584 584 function get_intermediate_image_sizes() { 585 585 global $_wp_additional_image_sizes; 586 $image_sizes = array('thumbnail', 'medium', 'large'); // Standard sizes 586 $image_sizes = array('thumbnail', 'medium', 'large'); // Standard sizes 587 foreach ( $image_sizes as $size ) { 588 $image_sizes[ $size ]['width'] = intval( get_option( "{$size}_size_w") ); 589 $image_sizes[ $size ]['height'] = intval( get_option( "{$size}_size_h") ); 590 // Crop false per default if not set 591 $image_sizes[ $size ]['crop'] = get_option( "{$size}_crop" ) ? get_option( "{$size}_crop" ) : false; 592 } 587 593 if ( isset( $_wp_additional_image_sizes ) && count( $_wp_additional_image_sizes ) ) 588 594 $image_sizes = array_merge( $image_sizes, array_keys( $_wp_additional_image_sizes ) ); 589 595 -
wp-includes/post.php
3817 3817 } 3818 3818 3819 3819 // remove intermediate and backup images if there are any 3820 foreach ( get_intermediate_image_sizes() as $size ) {3820 foreach ( array_keys( get_intermediate_image_sizes() ) as $size ) { 3821 3821 if ( $intermediate = image_get_intermediate_size($post_id, $size) ) { 3822 3822 $intermediate_file = apply_filters('wp_delete_file', $intermediate['path']); 3823 3823 @ unlink( path_join($uploadpath['basedir'], $intermediate_file) );