WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 months ago

#14076 closed defect (bug) (duplicate)

Misleading post count on taxonomy screen — at Version 14

Reported by: bunnykins Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Posts, Post Types Keywords:
Focuses: Cc:

Description (last modified by scribu)

Register a post type that supports categories.

Wether you go to:

wp-admin/edit-tags.php?taxonomy=category

or to:

wp-admin/edit-tags.php?taxonomy=category&post_type=example

the Posts column displays the same counts.

This leaves users the false impression that category archives should display posts with any post type.

Change History (14)

comment:1 @bunnykins5 years ago

I discovered a work around by mistake. The work around is to make the entry as both a normal post type and then the newly created post type and boom it fixes it. Well sort of. Creating an entry twice to get categories and tags to work for post types seems silly.

comment:2 @scribu5 years ago

  • Description modified (diff)

The problem is that the counts you see on the categories page is

comment:3 @scribu5 years ago

  • Description modified (diff)
  • Milestone changed from Unassigned to 3.1
  • Severity changed from critical to major
  • Summary changed from custom post types and catagories and tags to Misleading post count on taxonomy screen

The problem is that the post count is global accross all post types. It should be restricted to the current post type.

comment:4 @scribu5 years ago

Related: #14073

comment:5 @scribu5 years ago

Related: #14084

comment:6 @bunnykins5 years ago

I might be reading your replies wrong but the replies do not seem address the problem I am having and that is using the categories and tags with the post types and then being able to click on those categories and seeing those entries. The count that is shows is a minor issues compared to the true issue I am talking about.

comment:7 @nacin5 years ago

bunnykins: Are you referring to #14061?

comment:8 @bunnykins5 years ago

I am not sure as I am having a bit of an issue reading what is being said there.

In looking at my issue the count is actually correct just when you click on the category it does not display the entries that are in that category for that post type.

comment:9 @nacin5 years ago

Where is this inaccurate count? Back end? On your theme?

Sorry, but your steps to reproduce are a bit confusing.

comment:10 follow-up: @scribu5 years ago

The issue I was refering to is this:

Register a post type that supports categories.

Wether you go to:

wp-admin/edit-tags.php?taxonomy=category

or to:

wp-admin/edit-tags.php?taxonomy=category&post_type=example

the Posts column displays the same counts.

comment:11 @bunnykins5 years ago

Ok create a custom post type that uses the built in categories and tags.
Then create entries in the custom post type, set them to use one of the categories you already have created.
Say you have 3 entries created in that post type and in the same category. So you now have 3 entries in that category as well as 3 entries in the new post type.

Now go to your main page and if you have the category's widget set up it should show that category with 3 entries.

Now here is where the issue is. When you click on that category it shows no entries as if you never created any entries for that category or searched for some thing that does not exist on the site.

comment:12 in reply to: ↑ 10 @bunnykins5 years ago

Replying to scribu:
> The issue I was refering to is this:

Register a post type that supports categories.

Wether you go to:

wp-admin/edit-tags.php?taxonomy=category

or to:

wp-admin/edit-tags.php?taxonomy=category&post_type=example

the Posts column displays the same counts.

Oh I was not aware that was a bug, it seemed normal to me for it to act that way, infact I would prefer it to work that way as it is showing the correct info regardless of which category's screen you are at.

My issue is related to the none admin side of things as mentioned above and I am using the new skin.

comment:13 @scribu5 years ago

  • Milestone 3.1 deleted
  • Resolution set to wontfix
  • Status changed from new to closed
  • Summary changed from Misleading post count on taxonomy screen to Categories not aware of custom post types

Ok, now I finally got what you're saying.

That is the expected behaviour: category archives only display regular posts.

I'm going to close this ticket and post a solution in the original support topic.

comment:14 @scribu5 years ago

  • Description modified (diff)
  • Milestone set to 3.1
  • Summary changed from Categories not aware of custom post types to Misleading post count on taxonomy screen

Actually, the reason you expected it to show all posts is precisely because of those post counts.

So, it's still an issue, except it should be fixed in a different way.

Note: See TracTickets for help on using tickets.