Ticket #22750: 22750.diff
| File 22750.diff, 1.1 KB (added by , 13 years ago) |
|---|
-
wp-includes/js/media-models.js
263 263 // Overload the `delete` request so attachments can be removed. 264 264 // This will permanently delete an attachment. 265 265 } else if ( 'delete' === method ) { 266 this.destroyed = true; 266 267 options = options || {}; 267 268 options.context = this; 268 269 options.data = _.extend( options.data || {}, { … … 270 271 id: this.id, 271 272 _wpnonce: this.get('nonces')['delete'] 272 273 }); 273 return media.ajax( options ); 274 275 return media.ajax( options ).fail( function() { 276 this.destroyed = false; 277 }); 274 278 } 275 279 }, 276 280 … … 401 405 this.reset( this._source.filter( this.validator, this ) ); 402 406 }, 403 407 408 validateDestroyed: false, 409 404 410 validator: function( attachment ) { 411 if ( ! this.validateDestroyed && attachment.destroyed ) 412 return false; 405 413 return _.all( this.filters, function( filter, key ) { 406 414 return !! filter.call( this, attachment ); 407 415 }, this );