Make WordPress Core

Changeset 55180


Ignore:
Timestamp:
02/01/2023 08:29:56 PM (18 months ago)
Author:
joedolson
Message:

Media: Remove meta data after restoring w/IMAGE_EDIT_OVERWRITE.

When IMAGE_EDIT_OVERWRITE is defined as true the meta field _wp_attachment_backup_sizes is deleted after an image is restored.

Props mitogh, jeawhanlee, robinwpdeveloper, iapial.
Fixes #55150.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/image-edit.php

    r54891 r55180  
    811811    } else {
    812812        $msg->msg = __( 'Image restored successfully.' );
     813        if ( defined( 'IMAGE_EDIT_OVERWRITE' ) && IMAGE_EDIT_OVERWRITE ) {
     814            delete_post_meta( $post_id, '_wp_attachment_backup_sizes' );
     815        }
    813816    }
    814817
Note: See TracChangeset for help on using the changeset viewer.