[wp-trac] [WordPress Trac] #53613: Add filter to prevent term deletion

WordPress Trac noreply at wordpress.org
Tue Jul 6 22:39:52 UTC 2021


#53613: Add filter to prevent term deletion
-----------------------------------+------------------------------
 Reporter:  davedoesthings         |       Owner:  (none)
     Type:  enhancement            |      Status:  new
 Priority:  normal                 |   Milestone:  Awaiting Review
Component:  Taxonomy               |     Version:
 Severity:  normal                 |  Resolution:
 Keywords:  has-patch 2nd-opinion  |     Focuses:
-----------------------------------+------------------------------
Changes (by jorbin):

 * keywords:  has-patch => has-patch 2nd-opinion


Comment:

 Welcome to trac @davedoesthings.

 I'm not sure if I love the idea of adding an additional filter here for
 this use case. Core only calls `wp_delete_term` in a couple of places,
 each of them has a check for the `delete_term` capability.  I feel like
 using the `map_meta_cap` filter might lead to a better result since then
 the UI would also be updated to not display the trash link.

 the pre_delete_post bailout was added since deleting a post can be
 resource-intensive, especially on some custom sites. #32933.

 I wonder if there are other use cases for this filter that map_meta_cap
 wouldn't be able to solve.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/53613#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list