mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@55180 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -810,6 +810,9 @@ function wp_restore_image( $post_id ) {
|
||||
$msg->error = __( 'Image metadata is inconsistent.' );
|
||||
} else {
|
||||
$msg->msg = __( 'Image restored successfully.' );
|
||||
if ( defined( 'IMAGE_EDIT_OVERWRITE' ) && IMAGE_EDIT_OVERWRITE ) {
|
||||
delete_post_meta( $post_id, '_wp_attachment_backup_sizes' );
|
||||
}
|
||||
}
|
||||
|
||||
return $msg;
|
||||
|
||||
Reference in New Issue
Block a user