#24187 closed defect (bug) (duplicate)
Parent Category Count Update
| Reported by: | vivek.jain | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Taxonomy | Version: | 1.5 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
Description
WordFlow:
When I assign a child category to a post then its automatically gets appended with the respective Parent category. The post appears in for both, parent as well as the child category.
Bug:
Only the child category count is updated and not the parent category's.
Environment:
Tested on latest version, and on fresh install.
Change History (4)
#3
in reply to: ↑ 2
@
13 years ago
- Milestone Awaiting Review
- Status new → closed
- Version 3.5.1 → 1.5
Replying to 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:
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:
http://core.trac.wordpress.org/browser/tags/3.5.1/wp-includes/category-template.php#L323
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
I think it's by design that the count is only for posts explicitly connected to that category. You can move a category to another parent, and in such case it would involve a huge recount on sites with many posts.
There are two alternatives, besides "fixing" it in core:
Expect a wontfix. IMO.