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. Built from https://develop.svn.wordpress.org/trunk@31024 git-svn-id: http://core.svn.wordpress.org/trunk@31005 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -376,7 +376,12 @@ function wp_dropdown_categories( $args = '' ) {
|
||||
if ( (int) $tab_index > 0 ) {
|
||||
$tab_index_attribute = " tabindex=\"$tab_index\"";
|
||||
}
|
||||
$categories = get_terms( $r['taxonomy'], $r );
|
||||
|
||||
// Avoid clashes with the 'name' param of get_terms().
|
||||
$get_terms_args = $r;
|
||||
unset( $get_terms_args['name'] );
|
||||
$categories = get_terms( $r['taxonomy'], $get_terms_args );
|
||||
|
||||
$name = esc_attr( $r['name'] );
|
||||
$class = esc_attr( $r['class'] );
|
||||
$id = $r['id'] ? esc_attr( $r['id'] ) : $name;
|
||||
|
||||
Reference in New Issue
Block a user