mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Media: Display an error message in grid view if the attachment could not be deleted.
Previously, the attachment was silently removed from the grid but reappeared after a page reload. Follow-up to [22869]. Props kapilpaul, costdev, mukesh27, azouamauriac, SergeyBiryukov. Fixes #55158. git-svn-id: https://develop.svn.wordpress.org/trunk@52725 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
bc1c4a5eb1
commit
eb6ed4faec
@ -154,7 +154,13 @@ Details = Attachment.extend(/** @lends wp.media.view.Attachment.Details.prototyp
|
||||
this.getFocusableElements();
|
||||
|
||||
if ( window.confirm( l10n.warnDelete ) ) {
|
||||
this.model.destroy();
|
||||
this.model.destroy( {
|
||||
wait: true,
|
||||
error: function() {
|
||||
window.alert( l10n.errorDeleting );
|
||||
}
|
||||
} );
|
||||
|
||||
this.moveFocus();
|
||||
}
|
||||
},
|
||||
|
||||
@ -4482,6 +4482,7 @@ function wp_enqueue_media( $args = array() ) {
|
||||
'trashSelected' => __( 'Move to Trash' ),
|
||||
'restoreSelected' => __( 'Restore from Trash' ),
|
||||
'deletePermanently' => __( 'Delete permanently' ),
|
||||
'errorDeleting' => __( 'Error in deleting the attachment.' ),
|
||||
'apply' => __( 'Apply' ),
|
||||
'filterByDate' => __( 'Filter by date' ),
|
||||
'filterByType' => __( 'Filter by type' ),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user