Ticket #24518: post.php.patch
File post.php.patch, 1.3 KB (added by , 11 years ago) |
---|
-
wp-includes/post.php
4086 4086 $backup_sizes = get_post_meta( $post->ID, '_wp_attachment_backup_sizes', true ); 4087 4087 $file = get_attached_file( $post_id ); 4088 4088 4089 $intermediate_sizes = array();4090 foreach ( get_intermediate_image_sizes() as $size ) {4091 if ( $intermediate = image_get_intermediate_size( $post_id, $size ) )4092 $intermediate_sizes[] = $intermediate;4093 }4094 4095 4089 if ( is_multisite() ) 4096 4090 delete_transient( 'dirsize_cache' ); 4097 4091 … … 4126 4120 } 4127 4121 4128 4122 // remove intermediate and backup images if there are any 4129 foreach ( $intermediate_sizes as $intermediate ) { 4130 $intermediate_file = apply_filters( 'wp_delete_file', $intermediate['path'] ); 4131 @ unlink( path_join($uploadpath['basedir'], $intermediate_file) ); 4123 if ( isset( $meta['sizes'] ) && is_array( $meta['sizes'] ) ) { 4124 foreach ( $meta['sizes'] as $size => $sizeinfo ) { 4125 $intermediate_file = str_replace( basename( $file ), $sizeinfo['file'], $file ); 4126 $intermediate_file = apply_filters( 'wp_delete_file', $intermediate_file ); 4127 @ unlink( path_join( $uploadpath['basedir'], $intermediate_file ) ); 4128 } 4132 4129 } 4133 4130 4134 4131 if ( is_array($backup_sizes) ) {