[wp-trac] [WordPress Trac] #35227: Add unregister_taxonomy()

WordPress Trac noreply at wordpress.org
Sat Dec 26 10:11:06 UTC 2015


#35227: Add unregister_taxonomy()
--------------------------+------------------------------------------------
 Reporter:  swissspidy    |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  4.5
Component:  Taxonomy      |    Version:  2.3
 Severity:  normal        |   Keywords:  early needs-patch needs-unit-tests
  Focuses:                |
--------------------------+------------------------------------------------
 This is a follow-up to #11058.

 While working on #14761 I stumbled upon the former ticket suggesting
 adding a `unregister_taxonomy()` function. It ended up with the addition
 of a new `register_taxonomy_for_object_type()` function.

 Since `_unregister_taxonomy()` is used across all unit tests, I think we
 should add a real function for this for developers.

 From Nacin's [ticket:11058#comment:26 comment] from three years ago:

 > An `unregister_taxonomy()` function needs to un-roll quite a bit:
 > * Remove the query var from the `WP` class, if one was registered.
 > * Remove any rewrite tags and permastructs.
 > * Remove the callback for handling the meta box.
 >
 > An `unregister_taxonomy()` function should disallow the unregistration
 of 'post_tag' and 'category' until core does not assume they exist in
 many, many locations. The same block might also need to be in place in
 `unregister_taxonomy_for_object_type()` for the 'post' object type until
 core no longer breaks under any existing assumptions as well.

 I'm gonna work on this together with #14761.

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


More information about the wp-trac mailing list