[wp-trac] [WordPress Trac] #15143: Walker_Category::start_el() with custom taxonomy
WordPress Trac
wp-trac at lists.automattic.com
Sun Oct 17 23:38:13 UTC 2010
#15143: Walker_Category::start_el() with custom taxonomy
--------------------------+-------------------------------------------------
Reporter: TheDeadMedic | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Taxonomy | Version:
Severity: normal | Keywords:
--------------------------+-------------------------------------------------
Although {{{wp_list_categories()}}} supports custom taxonomies,
{{{Walker_Category::start_el()}}} calls {{{get_category()}}} if the
argument 'current_category' is passed, ignoring the taxonomy argument.
{{{
if ( isset($current_category) && $current_category )
$_current_category = get_category( $current_category );
}}}
Minor side effects currently include unnecessary database queries and
failure to add 'current-cat-parent' class(es).
Simple fix would be to check for the taxonomy argument, and use
{{{get_term()}}} instead;
{{{
if ( isset($current_category) && $current_category )
$_current_category = get_term( $current_category, isset($taxonomy)
? $taxonomy : 'category' );
}}}
--
Ticket URL: <http://core.trac.wordpress.org/ticket/15143>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list