From 29efc53b6af1ad7ef0afb149c9a89deb75c7f73b Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Thu, 15 May 2014 15:47:43 +0000 Subject: [PATCH] Eliminate use of `extract()` in `wp_dropdown_categories()`. See #22400. git-svn-id: https://develop.svn.wordpress.org/trunk@28432 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/category-template.php | 48 +++++++++++++-------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/wp-includes/category-template.php b/src/wp-includes/category-template.php index 7912ca7bfd..ff8fb895da 100644 --- a/src/wp-includes/category-template.php +++ b/src/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; }