[wp-trac] Re: [WordPress Trac] #8614: With wp_list_categories child
categories not excluded when parents are excluded
WordPress Trac
wp-trac at lists.automattic.com
Tue Dec 23 11:29:28 GMT 2008
#8614: With wp_list_categories child categories not excluded when parents are
excluded
-------------------------------------------------------------------------------------+
Reporter: marketingfm | Owner: anonymous
Type: defect (bug) | Status: new
Priority: normal | Milestone: 2.7.1
Component: General | Version: 2.7
Severity: normal | Resolution:
Keywords: has-patch get_terms wp_list_categories exclude exclude_tree 2nd-opinion |
-------------------------------------------------------------------------------------+
Comment (by filosofo):
Replying to [comment:11 jhodgdon]:
> I also don't agree with you about the expectations. To me, it seems more
normal that excluding a category should exclude its children. The reverse
idea seems odd.
[[BR]]
Please don't misunderstand me; I think your expectations are at least as
valid as anyone else's---that wasn't my point. The problem is a matter of
semantics and consistency.
[[BR]]
Consistency, because that's not how page queries work ("exclude"-ing a
parent page doesn't exclude its children), or categories in the Loop
(using "{{{category__not_in}}}" will not exclude posts which are in child
categories), or posts with children (see "{{{post__not_in}}}").
Semantics, because {{{wp_list_categories}}} rests on top of the terms, and
terms can have an indefinite number of relationships or none at all, so
"exclude"-ing one implies nothing about what should happen to others. The
result is ambiguity.
[[BR]]
> Of course, since 2.7 already went out with this bug, anyone who upgraded
is already broken...
[[BR]]
I've attached a second patch that maintains backwards-compatibility for
{{{wp_list_categories}}}, when hierarchical is true (the default).
--
Ticket URL: <http://trac.wordpress.org/ticket/8614#comment:12>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list