@megamenu I have to admit I don’t really get your question. Widgets in sub menus? Also I can’t find the code you provided. Searching the code for the terms widgets, menu and theme_location results in something like this:
if (has_nav_menu($location)) {
$menu = get_nav_menu_locations();
ob_start();
wp_nav_menu([
'theme_location' => $location,
'menu' => $menu[$location],
'split' => $location == 'navbar',
]);
$widget = $this->createWidget([
'id' => "menu-{$sidebar}",
'type' => 'menu',
'content' => ob_get_clean(),
]);
array_unshift($items, $widget);
}
in \wp-content\themes\yootheme\vendor\yootheme\theme-wordpress-widgets\src\WidgetsListener.php:112
or this
// Register menu locations.
foreach ($theme->options['menus'] as $id => $name) {
register_nav_menu($id, __($name));
}
// Add filter to menu arguments.
add_filter('wp_nav_menu_args', function ($args) {
return array_replace($args, array(
'walker' => new MenuWalker(get_current_sidebar(), $args),
'container' => false,
'fallback_cb' => false,
'items_wrap' => '%3$s',
));
});
in \wp-content\themes\yootheme\functions.php:115
But I’m not a programmer, just a big fan of the theme and for a current project I’m using your plugin with YOOtheme and stumbled upon this thread.
One real issue I had with the plugin/theme-combination was the menu location. So I created custom ones with your plugin and assigned the menu to the newly created ones.
Is this what you where referring to?