[wp-trac] [WordPress Trac] #28083: exclude_tree gets overwritten in wp_list_categories
WordPress Trac
noreply at wordpress.org
Wed Apr 30 20:24:19 UTC 2014
#28083: exclude_tree gets overwritten in wp_list_categories
--------------------------+-----------------------------
Reporter: MikeHansenMe | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Taxonomy | Version:
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
When using the function wp_list_categories and passing 'exclude_tree' the
value gets overwritten by 'exclude' which by default is ''. This is
because of the following lines in the function:
{{{
if ( true == $r['hierarchical'] ) {
$r['exclude_tree'] = $r['exclude'];
$r['exclude'] = '';
}
}}}
Hierarchical is true by default so unless you set that to false the code
gets ran. Unless you pass a value to 'exclude' then the default overwrites
'exclude_tree' which may have been set.
I have included a patch and some unit tests for the wp_list_categories
function.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/28083>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list