- Timestamp:
- 11/30/2017 11:09:33 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-walker-category-checklist.php
r41688 r42343 19 19 class Walker_Category_Checklist extends Walker { 20 20 public $tree_type = 'category'; 21 public $db_fields = array ('parent' => 'parent', 'id' => 'term_id'); //TODO: decouple this 21 public $db_fields = array( 22 'parent' => 'parent', 23 'id' => 'term_id', 24 ); //TODO: decouple this 22 25 23 26 /** … … 33 36 */ 34 37 public function start_lvl( &$output, $depth = 0, $args = array() ) { 35 $indent = str_repeat("\t", $depth);38 $indent = str_repeat( "\t", $depth ); 36 39 $output .= "$indent<ul class='children'>\n"; 37 40 } … … 49 52 */ 50 53 public function end_lvl( &$output, $depth = 0, $args = array() ) { 51 $indent = str_repeat("\t", $depth);54 $indent = str_repeat( "\t", $depth ); 52 55 $output .= "$indent</ul>\n"; 53 56 } … … 80 83 81 84 $args['popular_cats'] = empty( $args['popular_cats'] ) ? array() : $args['popular_cats']; 82 $class = in_array( $category->term_id, $args['popular_cats'] ) ? ' class="popular-category"' : '';85 $class = in_array( $category->term_id, $args['popular_cats'] ) ? ' class="popular-category"' : ''; 83 86 84 87 $args['selected_cats'] = empty( $args['selected_cats'] ) ? array() : $args['selected_cats']; … … 86 89 if ( ! empty( $args['list_only'] ) ) { 87 90 $aria_checked = 'false'; 88 $inner_class = 'category';91 $inner_class = 'category'; 89 92 90 93 if ( in_array( $category->term_id, $args['selected_cats'] ) ) { … … 101 104 /** This filter is documented in wp-includes/category-template.php */ 102 105 $output .= "\n<li id='{$taxonomy}-{$category->term_id}'$class>" . 103 '<label class="selectit"><input value="' . $category->term_id . '" type="checkbox" name="' .$name.'[]" id="in-'.$taxonomy.'-' . $category->term_id . '"' .106 '<label class="selectit"><input value="' . $category->term_id . '" type="checkbox" name="' . $name . '[]" id="in-' . $taxonomy . '-' . $category->term_id . '"' . 104 107 checked( in_array( $category->term_id, $args['selected_cats'] ), true, false ) . 105 108 disabled( empty( $args['disabled'] ), false, false ) . ' /> ' .
Note: See TracChangeset
for help on using the changeset viewer.