Make WordPress Core

Opened 12 years ago

Last modified 5 years ago

#19031 new defect (bug)

Category view incorrectly counting custom posts

Reported by: fireproofsocks's profile fireproofsocks Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.2
Component: Posts, Post Types Keywords: needs-patch
Focuses: Cc:

Description (last modified by SergeyBiryukov)

If you define a custom post-type something like this:

Array
(
    [taxonomies] => Array
        (
            [0] => category
            [1] => post_tag
        )
    
    [label] => Book
    [rewrite_slug] => 
    [query_var] => 
    [public] => 
    [show_ui] => 1
    [show_in_nav_menus] => 1
    [publicly_queryable] => 
    [exclude_from_search] => 1
)

Even if the post-type is NOT public or NOT publicly_queriable (see above), the counts of the posts in each category still shows, totally ignoring the settings of the post-type.

Expected Output

I would expect the count to be related to the results displayed. If there are no visible results for that category (i.e. the user can't see them due to public settings), I would expect the count to go to zero.

Actual Output

The count of posts in the given category seems to have nothing to do with the visible results.

This is related to this bug: #18950

Change History (7)

#1 @scribu
12 years ago

Related: #14084

#2 follow-up: @fireproofsocks
12 years ago

The more I think about it, I think that this should be tied to the exclude_from_search parameter, since category views are in essence a type of search, whereas publicly_queryable would control whether any aspect of the post is visible anywhere on the front-end.

#3 @jazbek
12 years ago

  • Cc j.yzbek@… added

#4 @SergeyBiryukov
11 years ago

  • Component changed from General to Post Types
  • Description modified (diff)

#6 in reply to: ↑ 2 @webord
11 years ago

And if the Taxonomy is tied up with another Post Type that has exclude_from_search or publicly_queryable set to true?

Replying to fireproofsocks:

The more I think about it, I think that this should be tied to the exclude_from_search parameter, since category views are in essence a type of search, whereas publicly_queryable would control whether any aspect of the post is visible anywhere on the front-end.

#7 @chriscct7
9 years ago

  • Keywords needs-patch added
  • Version changed from 3.2.1 to 3.2
Note: See TracTickets for help on using tickets.