[wp-trac] [WordPress Trac] #28719: Neither wp_delete_post or wp_delete_object_term_relationships deleting taxonomy relationships in uninstall.php when using custom post types and custom taxonomies.

WordPress Trac noreply at wordpress.org
Tue Feb 3 03:09:18 UTC 2015


#28719: Neither wp_delete_post or wp_delete_object_term_relationships deleting
taxonomy relationships in uninstall.php when using custom post types and
custom taxonomies.
-------------------------------------+------------------------------
 Reporter:  jmds                     |       Owner:
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  Awaiting Review
Component:  Database                 |     Version:  3.9.1
 Severity:  normal                   |  Resolution:
 Keywords:  reporter-feedback close  |     Focuses:
-------------------------------------+------------------------------
Changes (by dd32):

 * keywords:   => reporter-feedback close


Comment:

 Hi jmds,
 First of all, sorry you never received a response to this ticket.

 Without seeing code, it's hard to see what the actual problem you've run
 into was, but I'll take a guess based on the most common reason.
 When the plugins `uninstall.php` file is included, the plugin is not
 active, this means that any taxonomies and post_type's need to be
 registered upon `uninstall.php` being called. Simply including the main
 plugin file is often not enough either, as the `init` action has already
 been run, so usually the function/method responsible for registering the
 taxonomy needs to be called directly from `uninstall.php`.

 Another way of looking at it, is that `uninstall.php` is designed to be
 self-contained, it's not supposed to rely upon the plugin setting up the
 environment, and including the plugin automatically directly during
 uninstall can often lead to bugs with plugins that don't expect to work
 like that.

 If this sounds like the issue you ran into, this ticket can be safely
 closed I believe.

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


More information about the wp-trac mailing list