[wp-trac] [WordPress Trac] #32933: Allow pre-delete bailout in `wp_delete_post()`

WordPress Trac noreply at wordpress.org
Thu Jul 9 01:45:29 UTC 2015


#32933: Allow pre-delete bailout in `wp_delete_post()`
-------------------------------+-----------------------------
 Reporter:  boonebgorges       |      Owner:
     Type:  enhancement        |     Status:  new
 Priority:  normal             |  Milestone:  Awaiting Review
Component:  Posts, Post Types  |    Version:
 Severity:  normal             |   Keywords:  has-patch
  Focuses:                     |
-------------------------------+-----------------------------
 I've worked on a number of custom projects where post deletion is a
 resource-intensive process - such as when posts are arranged
 hierarchically, and deleting an item deletes the entire tree. In these
 cases, I've written custom delete routines that create a queue and then
 delete from the queue in batches. This generally works OK.

 The problem is that when an item is queued for batch deletion, I want to
 prevent its deletion in other contexts: specifically, bulk actions on
 edit.php and Empty Trash. Currently, there's no way to do this, short of
 intercepting and modifying `$_REQUEST`.

 It'd be nice if there was a way to bail out of post deletion, no matter
 which interface is the origin of the deletion. The attached patch suggests
 one way, modeled on the `*_metadata()` 'pre_' filters.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/32933>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list