diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index 28d8b03e3b..6003f5fd0c 100644 --- a/wp-admin/includes/template.php +++ b/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
  • " . + ''; } /**