Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #40672, comment 2


Ignore:
Timestamp:
05/05/2017 02:18:25 PM (7 years ago)
Author:
caercam
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #40672, comment 2

    initial v1  
    2525
    2626Makes sense to me. For now that's kind of hard-coded in `wp-api.js` -- see [https://core.trac.wordpress.org/browser/trunk/src/wp-includes/js/wp-api.js#L1213] -- so the only Models having the `requireForceForDelete` property defined are `PostRevision`, `PageRevision` and `UsersMe`. The other Models that support trashing shouldn't be concerned, but `Category` and `Tag` are made impossible to delete, unless you add the `requireForceForDelete` property yourself before calling `destroy()`.
     27
     28Edit: it should be noted that the model you're trying to delete will be removed from every collection it's been part of, no matter the API response. That can become annoying if you have views relying on those collections.