Changeset 28411
- Timestamp:
- 05/15/2014 03:13:44 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/template.php
r28410 r28411 71 71 */ 72 72 function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) { 73 extract($args); 74 if ( empty($taxonomy) ) 73 if ( empty( $args['taxonomy'] ) ) { 75 74 $taxonomy = 'category'; 76 77 if ( $taxonomy == 'category' ) 75 } else { 76 $taxonomy = $args['taxonomy']; 77 } 78 79 if ( $taxonomy == 'category' ) { 78 80 $name = 'post_category'; 79 else 80 $name = 'tax_input['.$taxonomy.']'; 81 82 $class = in_array( $category->term_id, $popular_cats ) ? ' class="popular-category"' : ''; 81 } else { 82 $name = 'tax_input[' . $taxonomy . ']'; 83 } 84 $args['popular_cats'] = empty( $args['popular_cats'] ) ? array() : $args['popular_cats']; 85 $class = in_array( $category->term_id, $args['popular_cats'] ) ? ' class="popular-category"' : ''; 86 87 $args['selected_cats'] = empty( $args['selected_cats'] ) ? array() : $args['selected_cats']; 83 88 84 89 /** This filter is documented in wp-includes/category-template.php */ 85 $output .= "\n<li id='{$taxonomy}-{$category->term_id}'$class>" . '<label class="selectit"><input value="' . $category->term_id . '" type="checkbox" name="'.$name.'[]" id="in-'.$taxonomy.'-' . $category->term_id . '"' . checked( in_array( $category->term_id, $selected_cats ), true, false ) . disabled( empty( $args['disabled'] ), false, false ) . ' /> ' . esc_html( apply_filters( 'the_category', $category->name ) ) . '</label>'; 90 $output .= "\n<li id='{$taxonomy}-{$category->term_id}'$class>" . 91 '<label class="selectit"><input value="' . $category->term_id . '" type="checkbox" name="'.$name.'[]" id="in-'.$taxonomy.'-' . $category->term_id . '"' . 92 checked( in_array( $category->term_id, $args['selected_cats'] ), true, false ) . 93 disabled( empty( $args['disabled'] ), false, false ) . ' /> ' . 94 esc_html( apply_filters( 'the_category', $category->name ) ) . '</label>'; 86 95 } 87 96
Note: See TracChangeset
for help on using the changeset viewer.