From 2b125a881bdd78addd8246c60575a6e91033a76a Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Thu, 15 May 2014 17:58:13 +0000 Subject: [PATCH] Eliminate use of `extract()` in `Walker_Category::start_el()`. See #22400. Built from https://develop.svn.wordpress.org/trunk@28436 git-svn-id: http://core.svn.wordpress.org/trunk@28263 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/category-template.php | 53 ++++++++++++++++--------------- 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/wp-includes/category-template.php b/wp-includes/category-template.php index 25d6da9c2e..21266fb60f 100644 --- a/wp-includes/category-template.php +++ b/wp-includes/category-template.php @@ -962,15 +962,15 @@ class Walker_Category extends Walker { * @param int $id ID of the current category. */ function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) { - extract($args); - - $cat_name = esc_attr( $category->name ); - /** This filter is documented in wp-includes/category-template.php */ - $cat_name = apply_filters( 'list_cats', $cat_name, $category ); + $cat_name = apply_filters( + 'list_cats', + esc_attr( $category->name ), + $category + ); - $link = 'description) ) { + $link = 'description ) ) { $link .= ''; } else { /** @@ -987,47 +987,50 @@ class Walker_Category extends Walker { $link .= '>'; $link .= $cat_name . ''; - if ( !empty($feed_image) || !empty($feed) ) { + if ( ! empty( $args['feed_image'] ) || ! empty( $args['feed'] ) ) { $link .= ' '; - if ( empty($feed_image) ) + if ( empty( $args['feed_image'] ) ) { $link .= '('; + } - $link .= 'term_id, $category->taxonomy, $args['feed_type'] ) ) . '"'; - if ( empty($feed) ) { + if ( empty( $args['feed'] ) ) { $alt = ' alt="' . sprintf(__( 'Feed for all posts filed under %s' ), $cat_name ) . '"'; } else { - $alt = ' alt="' . $feed . '"'; - $name = $feed; - $link .= $title; + $alt = ' alt="' . $args['feed'] . '"'; + $name = $args['feed']; + $link .= $args['title']; } $link .= '>'; - if ( empty($feed_image) ) + if ( empty( $args['feed_image'] ) ) { $link .= $name; - else - $link .= "'; - + } else { + $link .= "'; + } $link .= ''; - if ( empty($feed_image) ) + if ( empty( $args['feed_image'] ) ) { $link .= ')'; + } } - if ( !empty($show_count) ) + if ( ! empty( $args['show_count'] ) ) { $link .= ' (' . number_format_i18n( $category->count ) . ')'; - + } if ( 'list' == $args['style'] ) { $output .= "\tterm_id; - if ( !empty($current_category) ) { - $_current_category = get_term( $current_category, $category->taxonomy ); - if ( $category->term_id == $current_category ) + if ( ! empty( $args['current_category'] ) ) { + $_current_category = get_term( $args['current_category'], $category->taxonomy ); + if ( $category->term_id == $args['current_category'] ) { $class .= ' current-cat'; - elseif ( $category->term_id == $_current_category->parent ) + } elseif ( $category->term_id == $_current_category->parent ) { $class .= ' current-cat-parent'; + } } $output .= ' class="' . $class . '"'; $output .= ">$link\n";