From b788832722bdf8262f823b00589e04f1391deadc Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Thu, 15 May 2014 15:48:14 +0000 Subject: [PATCH] Eliminate use of `extract()` in `wp_dropdown_categories()`. See #22400. Built from https://develop.svn.wordpress.org/trunk@28432 git-svn-id: http://core.svn.wordpress.org/trunk@28259 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/category-template.php | 48 +++++++++++++++---------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/wp-includes/category-template.php b/wp-includes/category-template.php index 7912ca7bfd..ff8fb895da 100644 --- a/wp-includes/category-template.php +++ b/wp-includes/category-template.php @@ -344,27 +344,27 @@ function wp_dropdown_categories( $args = '' ) { $r = wp_parse_args( $args, $defaults ); - if ( !isset( $r['pad_counts'] ) && $r['show_count'] && $r['hierarchical'] ) { + if ( ! isset( $r['pad_counts'] ) && $r['show_count'] && $r['hierarchical'] ) { $r['pad_counts'] = true; } - extract( $r ); + $tab_index = $r['tab_index']; $tab_index_attribute = ''; - if ( (int) $tab_index > 0 ) + if ( (int) $tab_index > 0 ) { $tab_index_attribute = " tabindex=\"$tab_index\""; + } + $categories = get_terms( $r['taxonomy'], $r ); + $name = esc_attr( $r['name'] ); + $class = esc_attr( $r['class'] ); + $id = $r['id'] ? esc_attr( $r['id'] ) : $name; - $categories = get_terms( $taxonomy, $r ); - $name = esc_attr( $name ); - $class = esc_attr( $class ); - $id = $id ? esc_attr( $id ) : $name; - - if ( ! $r['hide_if_empty'] || ! empty($categories) ) + if ( ! $r['hide_if_empty'] || ! empty( $categories ) ) { $output = "\n"; - + } /** * Filter the taxonomy drop-down output. * @@ -423,9 +423,9 @@ function wp_dropdown_categories( $args = '' ) { */ $output = apply_filters( 'wp_dropdown_cats', $output, $r ); - if ( $echo ) + if ( $r['echo'] ) { echo $output; - + } return $output; }