Make WordPress Core


Ignore:
Timestamp:
01/02/2015 09:33:33 PM (12 years ago)
Author:
boonebgorges
Message:

Introduce 'name' parameter for get_terms().

This enhancement requires a modification in the way that wp_dropdown_categories()
prepares its arguments for get_terms(), so that its unrelated 'name' param is
not mistaken for the new 'name' argument in get_terms().

Props danielbachhuber.
Fixes #30611.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/category-template.php

    r31006 r31024  
    377377                $tab_index_attribute = " tabindex=\"$tab_index\"";
    378378        }
    379         $categories = get_terms( $r['taxonomy'], $r );
     379
     380        // Avoid clashes with the 'name' param of get_terms().
     381        $get_terms_args = $r;
     382        unset( $get_terms_args['name'] );
     383        $categories = get_terms( $r['taxonomy'], $get_terms_args );
     384
    380385        $name = esc_attr( $r['name'] );
    381386        $class = esc_attr( $r['class'] );
Note: See TracChangeset for help on using the changeset viewer.