[wp-trac] [WordPress Trac] #23069: For plugins that create custom taxonomies, wp_delete_term does not work during plugin uninstall.

WordPress Trac noreply at wordpress.org
Sun Dec 30 20:01:17 UTC 2012


#23069: For plugins that create custom taxonomies, wp_delete_term does not work
during plugin uninstall.
--------------------------+------------------------------
 Reporter:  sscovil       |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Taxonomy      |     Version:  3.5
 Severity:  normal        |  Resolution:
 Keywords:                |
--------------------------+------------------------------

Comment (by sscovil):

 Replying to [comment:3 SergeyBiryukov]:
 > The workaround is probably to re-register the taxonomy in
 `uninstall.php` before calling `wp_delete_term()`.

 Yeah, that would work I suppose...but that puts the burden on plugin
 developers to take an extra step that WP itself should handle. My goal in
 creating this uninstall class was actually to simplify things for plugin
 developers.

 I wonder if, before deactivation, WP could save $wp_taxonomies
 temporarily. Then, after deactivation, WP could compare the new
 $wp_taxonomies to the old and determine which taxonomies were registered
 by the plugin. Then, in the database, a relationship could be made between
 the taxonomy and the plugin so that, when uninstall.php is run, any terms
 associated with the plugin-specific taxonomy would automagically be
 removed.

 Does this sound feasible? Any ideas why it might not work, or what
 undesirable side-effects could result? If not, I'd be happy to attempt
 writing a patch...

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/23069#comment:4>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list