Support

Search results for ""

Sorry, no results found. Perhaps you would like to search the documentation?
All Topics
Robert

On taxonomy list, Count for distinct post types?

One of my several custom taxonomies is called “Source”.
And I have multiple post types, including “Articles”.

On the term-list page for “Sources” (edit-tags.php?taxonomy=source), I have the Count column.
However, this column has confused me no end over the last week.
For one term in question, I see a Count of 2,003. Yet I know there are only 2,000 “articles”.
I have been conversing with the maker of another plugin which I felt was at fault.
But now I think the reason is that there are three other post objects, in another post type, “Events”, which are also linked to the term I am talking about…

Essentially, the Count column seems to add up the count of all post objects related to this term, am I right?

That shouldn’t really expected, not least because the Source taxonomy list is loaded by clicking the “Source” link within the “Articles” menu (edit-tags.php?taxonomy=source&post_type=article).

What I would expect to happen is either or both or the following…

1. The context is respected (ie. if edit-tags.php?taxonomy=source&post_type=article was clicked, make the Count correspond to “article” – not sure WordPress works this way)

2. ACP offers the ability to add a more granular Count, for a specified post object. This way, I could add Count columns for multiple posts which are attached to this taxonomy.

Does any of this exist?

Thanks.

5 years, 5 months ago
Stefan van den Dungen Gronovius
Developer

Hi Robert,

Thanks for your feedback.
You’re correct the Count column counts the total of terms found for the entire taxonomy.
Although I agree with your proposal, this is not something that we want to change.
The count column is a default WordPress column and we choose not to alter the behavior of default and third-party columns.

Creating a new custom column where you can choose which post type it will count sounds like a better idea, although we have to see how heavy such column would be on performance. I will create a feature request for this on Github in our public issue list.

https://github.com/codepress/admin-columns-issues/issues/1155

5 years, 5 months ago
Robert

Stefan,

What’s the go-to thing to read about how to craft this as a custom column?
I’m not strictly a developer?

Thanks.

5 years, 5 months ago
Stefan van den Dungen Gronovius
Developer

We do have a page on our documentation that explains how to write your own column.
https://www.admincolumns.com/documentation/guides/creating-new-column-type/

It also comes with a toolkit. The key here is to manage the get_value() gets you the expected result.
But since it will run for each record on your overview, you must think about performance for this column.

What I mean with my previous comment though, is that I put it on the feature request list so we can have a look at it for you. I can’t give you a timeframe on when we start with this issue so if you don’t want or can’t wait for this, you could have a look at the documentation I sent you above.

Please let me know if anything is still unclear.

5 years, 5 months ago
Stefan van den Dungen Gronovius
Developer

Hi Robert,

I just added the column in the free experimental repo so you can try it out.
https://github.com/codepress/ac-addon-extra-columns

You can manually install the plugin.
You’ll have to activate the column through the settings menu before it is available (see description on Github)

5 years, 5 months ago

You must be logged in to reply to this topic.