Opened 15 years ago
Closed 9 years ago
#12981 closed defect (bug) (fixed)
odd behavior of exclude_tree parameter in wp_list_categories()
Reported by: | tott | Owned by: | tott |
---|---|---|---|
Milestone: | 4.4 | Priority: | normal |
Severity: | normal | Version: | 3.0 |
Component: | Taxonomy | Keywords: | has-patch |
Focuses: | Cc: |
Description
When running a query such as
<?php wp_list_categories('title_li=&exclude_tree=1234&orderby=name&order=ASC'); ?>
the exclude_tree parameter is not obeyed as [10276] introduced a change that would overwrite it with the exclude parameter.
Attachments (3)
Change History (19)
#1
@
14 years ago
- Milestone changed from Unassigned to 3.0
- Owner changed from filosofo to tott
- Status changed from new to assigned
- Version set to 3.0
#3
@
14 years ago
We've had this this way since 2.7.x at this point, though the patch looks good. I can't see anything it would break. Actually, exclude_tree was added in r10276, so it's never worked properly -- we can probably punt this in that case.
#6
@
14 years ago
exclude_tree doesn't work when hide_empty=0, it must must be set to 1 (hide empty)...
#7
@
14 years ago
- Keywords 2nd-opinion added; exclude_tree wp_list_categories category removed
- Milestone changed from Awaiting Triage to Future Release
#9
@
11 years ago
- Keywords needs-unit-tests added; 2nd-opinion removed
- Milestone changed from Future Release to 3.7
Let's make a decision on the new patch
#14
@
9 years ago
- Keywords needs-unit-tests removed
[attachment 12981.2.diff] adds a single unit test and refreshes the patch.
#15
@
9 years ago
- Keywords dev-feedback removed
- Milestone changed from Future Release to 4.4
Thanks for the patches. It looks like the reason for the if ( true === $hierarchical )
block is to ensure that excluding a category also excludes its descendants. So wiping out $r['exclude']
altogether doesn't seem like an acceptable strategy. We want to allow for the possibility that someone would pass exclude
*as well as* exclude_tree
, and have both of them (and their descendants) excluded from results.
Possible patch for exclude_tree problem in wp_list_categories()