From a415c29efee45520ae252d2aa28f1083a521cd7b Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 09:56:49 +0200 Subject: Adding upstream version 6.4.3+dfsg1. Signed-off-by: Daniel Baumann --- wp-includes/class-walker-nav-menu.php | 339 ++++++++++++++++++++++++++++++++++ 1 file changed, 339 insertions(+) create mode 100644 wp-includes/class-walker-nav-menu.php (limited to 'wp-includes/class-walker-nav-menu.php') diff --git a/wp-includes/class-walker-nav-menu.php b/wp-includes/class-walker-nav-menu.php new file mode 100644 index 0000000..4683970 --- /dev/null +++ b/wp-includes/class-walker-nav-menu.php @@ -0,0 +1,339 @@ + 'menu_item_parent', + 'id' => 'db_id', + ); + + /** + * Starts the list before the elements are added. + * + * @since 3.0.0 + * + * @see Walker::start_lvl() + * + * @param string $output Used to append additional content (passed by reference). + * @param int $depth Depth of menu item. Used for padding. + * @param stdClass $args An object of wp_nav_menu() arguments. + */ + public function start_lvl( &$output, $depth = 0, $args = null ) { + if ( isset( $args->item_spacing ) && 'discard' === $args->item_spacing ) { + $t = ''; + $n = ''; + } else { + $t = "\t"; + $n = "\n"; + } + $indent = str_repeat( $t, $depth ); + + // Default class. + $classes = array( 'sub-menu' ); + + /** + * Filters the CSS class(es) applied to a menu list element. + * + * @since 4.8.0 + * + * @param string[] $classes Array of the CSS classes that are applied to the menu `