[wp-trac] [WordPress Trac] #32533: wp_delete_post() is not deleting "wp_term_relationships"

WordPress Trac noreply at wordpress.org
Mon Jun 15 07:21:00 UTC 2015

#32533: wp_delete_post() is not deleting "wp_term_relationships"
 Reporter:  vishalkakadiya                       |       Owner:
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
Component:  Taxonomy                             |  Review
 Severity:  normal                               |     Version:  4.2.2
 Keywords:  needs-patch reporter-feedback close  |  Resolution:
                                                 |     Focuses:
Changes (by dd32):

 * keywords:  needs-patch => needs-patch reporter-feedback close
 * severity:  major => normal


 This sounds like the Custom Taxonomies were not registered at the time of
 deletion, or not attached to the post type correctly.

 `wp_delete_post()` calls `wp_delete_object_term_relationships($postid,
 get_object_taxonomies($post->post_type));` as part of it's deletion

 Changing this behaviour is not really possible at present, as we do not
 store the object-type in the term_relationships table. We have no idea if
 TaxA + Object123 is Post 123 or User 123 if TaxA is not attached to the

 Can you duplicate the issue you saw? Can you confirm that the taxomies
 were registered at that time?

Ticket URL: <https://core.trac.wordpress.org/ticket/32533#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list