Opened 7 years ago
#42572 new defect (bug)
Can't delete custom taxonomy tags from a post
Reported by: | thrica | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 4.9 |
Component: | Taxonomy | Keywords: | |
Focuses: | Cc: |
Description
Symptoms are the same as #39388: I can add terms in my custom taxonomy to a post, but I can't remove them. I'm not using any of the filters mentioned in that ticket. Based on logging all SQL queries on saving a post, it looks like removing a category triggers a query like:
DELETE FROM wp_term_relationships WHERE object_id = 1470 AND term_taxonomy_id IN ('7')
No DELETE query at all is running when I try to remove the custom taxonomy, so it's not a malformed query. Same problem whether I'm using the classic editor, the quick editor, or Gutenberg.
As a further wrinkle, in the classic editor, my terms don't even show up in the checkboxes in the sidebar (all of them are unchecked), though they do show up on the front end, in the quick editor, and in Gutenberg.
This didn't always happen, but I don't recall the version it started with. Disabling all plugins doesn't fix it, neither does clearing out my functions.php entirely, and neither does changing 'hierarchical' to false.
My arguments for registering the taxonomy are as follows:
$args = [ 'labels' => [ /* a bunch of strings */ ], 'public' => true, 'hierarchical' => true, 'show_in_rest' => true, 'rewrite' => ['hierarchical' => true], 'query_var' => 'idea' ];