$old_backup_sizes !==
$backup_sizes && !
update_post_meta( $post_id, '_wp_attachment_backup_sizes',
$backup_sizes ) ) ) { $msg->error =
__( 'Cannot save image metadata.'
);
return $msg;
} if ( !
$restored ) { $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;
}/**
* Saves image to post, along with enqueued changes
* in `$_REQUEST['history']`.
*
* @since 2.9.0
*
* @param int $post_id Attachment post ID.
* @return stdClass
*/