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

View File

@@ -2946,8 +2946,7 @@ function wp_delete_attachment( $post_id, $force_delete = false ) {
}
// remove intermediate and backup images if there are any
$sizes = apply_filters('intermediate_image_sizes', array('thumbnail', 'medium', 'large'));
foreach ( $sizes as $size ) {
foreach ( get_intermediate_image_sizes() as $size ) {
if ( $intermediate = image_get_intermediate_size($post_id, $size) ) {
$intermediate_file = apply_filters('wp_delete_file', $intermediate['path']);
@ unlink( path_join($uploadpath['basedir'], $intermediate_file) );