[wp-trac] [WordPress Trac] #24187: Parent Category Count Update
WordPress Trac
noreply at wordpress.org
Fri Apr 26 05:22:45 UTC 2013
#24187: Parent Category Count Update
--------------------------+---------------------
Reporter: vivek.jain | Owner:
Type: defect (bug) | Status: closed
Priority: normal | Milestone:
Component: Taxonomy | Version: 1.5
Severity: normal | Resolution:
Keywords: |
--------------------------+---------------------
Changes (by SergeyBiryukov):
* status: new => closed
* version: 3.5.1 => 1.5
* milestone: Awaiting Review =>
Comment:
Replying to [comment:2 knutsp]:
> I think it's by design that the count is only for posts explicitly
connected to that category.
Correct. This was previously discussed in #1062.
There's a `pad_counts` parameter in `get_terms()` for retrieving the
counts including child terms: [[BR]]
http://core.trac.wordpress.org/browser/tags/3.5.1/wp-
includes/taxonomy.php#L1152
The parameter can also be passed to `wp_dropdown_categories()` and
`wp_list_categories()`, although it's not documented there: [[BR]]
http://core.trac.wordpress.org/browser/tags/3.5.1/wp-includes/category-
template.php#L323 [[BR]]
http://core.trac.wordpress.org/browser/tags/3.5.1/wp-includes/category-
template.php#L429
> Always add the parent category when a child is added, manually or
enforced through a plugin.
Related: #16397.
Closing as a duplicate of #1062.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/24187#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list