mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-04 17:20:07 +00:00
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:
@@ -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) );
|
||||
|
||||
Reference in New Issue
Block a user