• Resolved cgzaal

    (@cgzaal)


    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.1

    This 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 version

    I 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 cgzaal.
    • This topic was modified 4 years, 4 months ago by cgzaal.
    • This topic was modified 4 years, 4 months ago by cgzaal.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author nwjames

    (@nwjames)

    @cgzaal
    Sorry to have inflicted this problem on you.

    I am very grateful for your help in raising this issue.

    Please could you let me know what you have set the option in the Terms Control to?
    That is, what are the post statuses that you want to count?

    Many thanks,
    Neil James

    Plugin Author nwjames

    (@nwjames)

    @cgzaal,
    I have been doing some tests today and found that my comment to your original topic was wrong.

    It does incorrectly over-ride the standard processing and then gets it wrong.

    I have released ed a new version of the plug-in that does not override the standard processing.

    I am sorry for any inconvenience caused to users and thank you for raising the problem.

    Regards,
    Neil James

    Plugin Author nwjames

    (@nwjames)

    @cgzaal,
    I am marking this resolved as there was an error in version 1.2.1.

    I believe that version 1.2.2 has fixed this. There has been no comment saying that it has not been fixed in thr 9 days since release.

    Regards,
    Neil James

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Counting error revisited’ is closed to new replies.