Opened 17 years ago
Closed 11 years ago
#12981 closed defect (bug) (fixed)
odd behavior of exclude_tree parameter in wp_list_categories()
| Reported by: | tott | Owned by: | tott |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.4 |
| Component: | Taxonomy | Version: | 3.0 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
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
@
16 years ago
- Milestone Unassigned → 3.0
- Owner changed from to
- Status new → assigned
- Version → 3.0
#3
@
16 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
@
16 years ago
exclude_tree doesn't work when hide_empty=0, it must must be set to 1 (hide empty)...
#7
@
16 years ago
- Keywords 2nd-opinion added; exclude_tree wp_list_categories category removed
- Milestone Awaiting Triage → Future Release
#9
@
13 years ago
- Keywords needs-unit-tests added; 2nd-opinion removed
- Milestone Future Release → 3.7
Let's make a decision on the new patch
#14
@
11 years ago
- Keywords needs-unit-tests removed
12981.2.diff adds a single unit test and refreshes the patch.
#15
@
11 years ago
- Keywords dev-feedback removed
- Milestone Future Release → 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Possible patch for exclude_tree problem in wp_list_categories()