Skip Navigation

[Résolu] Post Count for Custom Post Type and Custom Tax Term is wrong in backend

Ce fil est résolu. Voici une description du problème et la solution proposée.

Problem:
In the admin edit screens, the count of terms is wrong, when a taxonomy (and its terms) are shared among several CPTs.

The custom taxonomy is shared among 5 custom post types, but when checking a specific CPT taxonomy, the post count of each term is for ALL CPTs instead of the count for that specific CPT.
Solution:
In the wordpress back-end, the post count of term is outputted from your database table "wp_term_taxonomy", the value of column "count", which will count posts in all post types, so it isn't a bug, but an expected result:
the post count of each term is for ALL CPTs
Relevant Documentation:

This support ticket is created Il y a 7 années et 10 mois. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

Auteur
Publications
#410132

In the admin edit screens, the count of terms is wrong, when a taxonomy (and its terms) are shared among several CPTs.

The custom taxonomy is shared among 5 custom post types, but when checking a specific CPT taxonomy, the post count of each term is for ALL CPTs instead of the count for that specific CPT.

eg. here:
hidden link
The count for each term should only take into account the posts from "specificCPT", and not the posts with that tax/term is ALL CPTs, even if the tax/term is shared among several CPTs.

The issue only happens in backend.
Please advise, since this is a bug.

#410311

Dear Sanny,

In the wordpress back-end, the post count of term is outputted from your database table "wp_term_taxonomy", the value of column "count", which will count posts in all post types, so it isn't a bug, but an expected result:
the post count of each term is for ALL CPTs

If you agree, we can take it as a feature request.

#410824

I understand how the table works, but the expected behaviour, for the user, is to see the count for the specific post type they are trying to filter.
Usually taxonomies are not shared, in normal WP setup, so with Types, since it's possible, it would be great if this was taken into account too.
A JOIN in the db query could easily fix that.

#411182

Yes, it is possible with custom PHP codes, but according to our new support police, we do not provide custom codes support:
https://toolset.com/toolset-support-policy/

Also you can check out our certified partners for it:
https://toolset.com/consultant/

As I mentioned above, if you agree, I can put it into our to-do list as a feature request.

#411722

Sure, thank you.

However for paying customers, some custom code, hints at possible solutions or the right direction to follow, would be appreciated 😉

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.