Changeset 31765 for trunk/src/wp-admin/includes/template.php
- Timestamp:
- 03/13/2015 04:56:45 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/template.php
r31610 r31765 83 83 $name = 'tax_input[' . $taxonomy . ']'; 84 84 } 85 85 86 $args['popular_cats'] = empty( $args['popular_cats'] ) ? array() : $args['popular_cats']; 86 87 $class = in_array( $category->term_id, $args['popular_cats'] ) ? ' class="popular-category"' : ''; … … 89 90 90 91 /** This filter is documented in wp-includes/category-template.php */ 91 $output .= "\n<li id='{$taxonomy}-{$category->term_id}'$class>" . 92 '<label class="selectit"><input value="' . $category->term_id . '" type="checkbox" name="'.$name.'[]" id="in-'.$taxonomy.'-' . $category->term_id . '"' . 93 checked( in_array( $category->term_id, $args['selected_cats'] ), true, false ) . 94 disabled( empty( $args['disabled'] ), false, false ) . ' /> ' . 95 esc_html( apply_filters( 'the_category', $category->name ) ) . '</label>'; 92 if ( ! empty( $args['list_only'] ) ) { 93 $aria_cheched = 'false'; 94 $inner_class = 'category'; 95 96 if ( in_array( $category->term_id, $args['selected_cats'] ) ) { 97 $inner_class .= ' selected'; 98 $aria_cheched = 'true'; 99 } 100 101 $output .= "\n" . '<li' . $class . '>' . 102 '<div class="' . $inner_class . '" data-term-id=' . $category->term_id . 103 ' tabindex="0" role="checkbox" aria-checked="' . $aria_cheched . '">' . 104 esc_html( apply_filters( 'the_category', $category->name ) ) . '</div>'; 105 } else { 106 $output .= "\n<li id='{$taxonomy}-{$category->term_id}'$class>" . 107 '<label class="selectit"><input value="' . $category->term_id . '" type="checkbox" name="'.$name.'[]" id="in-'.$taxonomy.'-' . $category->term_id . '"' . 108 checked( in_array( $category->term_id, $args['selected_cats'] ), true, false ) . 109 disabled( empty( $args['disabled'] ), false, false ) . ' /> ' . 110 esc_html( apply_filters( 'the_category', $category->name ) ) . '</label>'; 111 } 96 112 } 97 113 … … 203 219 $tax = get_taxonomy( $taxonomy ); 204 220 $args['disabled'] = ! current_user_can( $tax->cap->assign_terms ); 221 222 $args['list_only'] = ! empty( $r['list_only'] ); 205 223 206 224 if ( is_array( $r['selected_cats'] ) ) {
Note: See TracChangeset
for help on using the changeset viewer.