From c4b23f9fc3ab8026a335e40b88e28f21aa0796bf Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Thu, 15 May 2014 03:13:44 +0000 Subject: [PATCH] Eliminate use of `extract()` in `Walker_Category_Checklist::start_el()`. See #22400. git-svn-id: https://develop.svn.wordpress.org/trunk@28411 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/template.php | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/wp-admin/includes/template.php b/src/wp-admin/includes/template.php index 28d8b03e3b..6003f5fd0c 100644 --- a/src/wp-admin/includes/template.php +++ b/src/wp-admin/includes/template.php @@ -70,19 +70,28 @@ class Walker_Category_Checklist extends Walker { * @param int $id ID of the current term. */ function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) { - extract($args); - if ( empty($taxonomy) ) + if ( empty( $args['taxonomy'] ) ) { $taxonomy = 'category'; + } else { + $taxonomy = $args['taxonomy']; + } - if ( $taxonomy == 'category' ) + if ( $taxonomy == 'category' ) { $name = 'post_category'; - else - $name = 'tax_input['.$taxonomy.']'; + } else { + $name = 'tax_input[' . $taxonomy . ']'; + } + $args['popular_cats'] = empty( $args['popular_cats'] ) ? array() : $args['popular_cats']; + $class = in_array( $category->term_id, $args['popular_cats'] ) ? ' class="popular-category"' : ''; - $class = in_array( $category->term_id, $popular_cats ) ? ' class="popular-category"' : ''; + $args['selected_cats'] = empty( $args['selected_cats'] ) ? array() : $args['selected_cats']; /** This filter is documented in wp-includes/category-template.php */ - $output .= "\n
  • " . ''; + $output .= "\n
  • " . + ''; } /**