Counting error revisited
-
Hi Neil,
Here I am back with the same counting error issue as before.
It took me a while to analyse the problem.
Here is what I did: I tried to update my custom taxonomy manually
using the following code I found on the internet:$update_taxonomy = 'my_taxonomy'; $get_terms_args = array( 'taxonomy' => $update_taxonomy, 'fields' => 'ids', 'hide_empty' => false, ); $update_terms = get_terms($get_terms_args); wp_update_term_count_now($update_terms, $update_taxonomy);
In testing I found out that:
– the code works with your plugin version 1.1.1
– the code doesn’t work with the most recent version 1.2.1This is what seems to happen (I am not an expert):
– when a post is edited, there is a taxonomy callback
– the callback calls for wp_update_term_count or a similar command
– in version 1.1.1 this sets the term count correctly
– in version 1.2.1. this sets the term count to zero (which is exactly the problem I am facing)
– this also happens in version 1.1.1 when I use the term count function of the plugin, not when I use the default term count function of WordPress
– this depends only on the version of the plugin, not on the WordPress versionI hope this helps. Can you see what is going on?
PS. I can still fix the problem by updating the database via an SQL query.
I could even do this from within WordPress, but if it has to do with the plugin,
it would be nice if it could be fixed there.PS2. The strange things is that the code above is plain WordPress code.
I do not see how the version of the plugin manages to change the action
of the code. Maybe you do.- This topic was modified 4 years, 4 months ago by .
- This topic was modified 4 years, 4 months ago by .
- This topic was modified 4 years, 4 months ago by .
The page I need help with: [log in to see the link]
- The topic ‘Counting error revisited’ is closed to new replies.