From 05706ec17d5c359ba86aa9cdd7685e637b4e25ab Mon Sep 17 00:00:00 2001 From: tradam Date: Tue, 18 Nov 2025 23:46:33 +0000 Subject: v 1.0 --- plugins/class-wp-picocss-navwalker.php | 57 ++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 plugins/class-wp-picocss-navwalker.php (limited to 'plugins') diff --git a/plugins/class-wp-picocss-navwalker.php b/plugins/class-wp-picocss-navwalker.php new file mode 100644 index 0000000..1cf617d --- /dev/null +++ b/plugins/class-wp-picocss-navwalker.php @@ -0,0 +1,57 @@ +\n"; + } + + public function end_lvl( &$output, $depth = 0, $args = array() ) { + $indent = str_repeat("\t", $depth); + $output .= "$indent\n"; + } + + public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) { + $has_children = in_array('menu-item-has-children', $item->classes); + + // Top-level item with children -> use
+ if ($depth === 0 && $has_children) { + $output .= ''; + } else { + $output .= ''; + } + } +} -- cgit v1.2.3