X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/febc815b2c9d85be5717da9e8d164bd2daa97e31..16e7b37c7914d753890c1a05a9335f3b43751eb8:/wp-includes/class-walker-page.php diff --git a/wp-includes/class-walker-page.php b/wp-includes/class-walker-page.php index fd55ccee..3fcaa67a 100644 --- a/wp-includes/class-walker-page.php +++ b/wp-includes/class-walker-page.php @@ -49,12 +49,19 @@ class Walker_Page extends Walker { * * @param string $output Passed by reference. Used to append additional content. * @param int $depth Optional. Depth of page. Used for padding. Default 0. - * @param array $args Optional. Arguments for outputing the next level. + * @param array $args Optional. Arguments for outputting the next level. * Default empty array. */ public function start_lvl( &$output, $depth = 0, $args = array() ) { - $indent = str_repeat("\t", $depth); - $output .= "\n$indent{$n}"; } /** @@ -89,8 +103,15 @@ class Walker_Page extends Walker { * @param int $current_page Optional. Page ID. Default 0. */ public function start_el( &$output, $page, $depth = 0, $args = array(), $current_page = 0 ) { + if ( 'preserve' === $args['item_spacing'] ) { + $t = "\t"; + $n = "\n"; + } else { + $t = ''; + $n = ''; + } if ( $depth ) { - $indent = str_repeat( "\t", $depth ); + $indent = str_repeat( $t, $depth ); } else { $indent = ''; } @@ -175,7 +196,14 @@ class Walker_Page extends Walker { * @param array $args Optional. Array of arguments. Default empty array. */ public function end_el( &$output, $page, $depth = 0, $args = array() ) { - $output .= "\n"; + if ( 'preserve' === $args['item_spacing'] ) { + $t = "\t"; + $n = "\n"; + } else { + $t = ''; + $n = ''; + } + $output .= "{$n}"; } }