Changeset 38523 for trunk/src/wp-includes/class-walker-nav-menu.php
- Timestamp:
- 09/06/2016 09:05:45 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-walker-nav-menu.php
r37640 r38523 51 51 */ 52 52 public function start_lvl( &$output, $depth = 0, $args = array() ) { 53 $indent = str_repeat("\t", $depth); 54 $output .= "\n$indent<ul class=\"sub-menu\">\n"; 53 if ( 'preserve' === $args->item_spacing ) { 54 $t = "\t"; 55 $n = "\n"; 56 } else { 57 $t = ''; 58 $n = ''; 59 } 60 $indent = str_repeat( $t, $depth ); 61 $output .= "{$n}{$indent}<ul class=\"sub-menu\">{$n}"; 55 62 } 56 63 … … 67 74 */ 68 75 public function end_lvl( &$output, $depth = 0, $args = array() ) { 69 $indent = str_repeat("\t", $depth); 70 $output .= "$indent</ul>\n"; 76 if ( 'preserve' === $args->item_spacing ) { 77 $t = "\t"; 78 $n = "\n"; 79 } else { 80 $t = ''; 81 $n = ''; 82 } 83 $indent = str_repeat( $t, $depth ); 84 $output .= "$indent</ul>{$n}"; 71 85 } 72 86 … … 86 100 */ 87 101 public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) { 88 $indent = ( $depth ) ? str_repeat( "\t", $depth ) : ''; 102 if ( 'preserve' === $args->item_spacing ) { 103 $t = "\t"; 104 $n = "\n"; 105 } else { 106 $t = ''; 107 $n = ''; 108 } 109 $indent = ( $depth ) ? str_repeat( $t, $depth ) : ''; 89 110 90 111 $classes = empty( $item->classes ) ? array() : (array) $item->classes; … … 217 238 */ 218 239 public function end_el( &$output, $item, $depth = 0, $args = array() ) { 219 $output .= "</li>\n"; 240 if ( 'preserve' === $args->item_spacing ) { 241 $t = "\t"; 242 $n = "\n"; 243 } else { 244 $t = ''; 245 $n = ''; 246 } 247 $output .= "</li>{$n}"; 220 248 } 221 249
Note: See TracChangeset
for help on using the changeset viewer.