class DropDown_Nav_Menu extends Walker_Nav_Menu { // Easy way to check it's this walker we're using to mod the output. public function is_dropdown() { return true; } /** * Start submenu level. * * Compatible with modern WordPress / PHP 8.x. */ public function start_lvl( &$output, $depth = 0, $args = null ) { $output .= ""; } /** * End submenu level. * * Compatible with modern WordPress / PHP 8.x. */ public function end_lvl( &$output, $depth = 0, $args = null ) { $output .= "\n", $item, $depth ); } }