wp_set_post_terms is not updating the count column in term_taxonomy

wp_set_post_terms($post_ID, 'my_term', 'my_taxonomy');

My problem is that in wp_term_taxonomy, the count is 0 but running that line of code should be making it 1.

I have also added to the register_taxonomy:

Read More
'update_count_callback' => '_update_post_term_count'

If I manually change the count to 1 then my other functionality displays so everything is being done correctly apart from the count column always being 0.

Does anyone know why this is happening?

Related posts

Leave a Reply

2 comments