Incorrect Post Counts on Custom Taxonomies When Post is Deleted
|Reported by:||chrisvrichardson||Owned by:|
|Component:||Taxonomy||Keywords:||taxonomy, delete, trash|
Post counts for terms in custom taxnomies do not seem to decrement when the post is first deleted (moved to the trash), only after the trash is emptied.
The issue seems to be present for both hierarchical and flat taxonomies.
- Create a custom taxonomy.
- Create a term in the custom taxonomy
- Create a category
- Create a post and assign the custom taxonomy term to it. Also assign the category to it.
- Check the post counts on the 'categories' screen and the screen for your custom taxonomy. Both will show a count of 1 post.
- Delete the post
- The category post count on the 'categories' screen will decrement to '0'. Your custom taxonomy term, however, will still show '1'. Clicking on it will take you to the posts screen with a message that the post doesn't exist.
- Empty the trash. Your custom taxonomy term will now show a correct count of '0'.
This issue may be related to tickets 14084 and 14073, although neither of those seemed to address it directly.