1 year, 4 months ago rmillerParticipant
To extend the sidebar menu functionality, I am using a popular widget called “Custom Menu Wizard Widget“. However, it doesn’t place nice with Tower.
I contacted the plugin developer and here is what he expressed as to an explanation and then a resolution at the end:
The theme (Tower) hooks into WordPress’s wp_nav_menu_args filter and, unless the menu being produced has a menu_id of “mobile-menu”, changes the “walker” to its own.
WordPress has a Walker class that is a general class for producing lists (which is all a menu is). WordPress also has a Walk_Nav_Menu class, which extends the Walker class specifically for menus. Usually plugins will provide their own “walker” as an extension of the WordPress Walker_Nav_Menu class. This is exactly what Custom Menu Wizard does : it uses its own extension of the Walker_Nav_Menu class to do the filtering and set extra classes.
However, because your theme is intercepting every production of a menu and changing the requested “walker” class to its own, the Custom Menu Wizard one never gets called. You’d probably find that other menu plugins (that have their own “walker”) would have exactly the same problem.
The theme code responsible can be found in tower/includes/core/codeless_megamenu.php, as part of the codeless_custom_menu class. The class is included into, and instantiated by, the theme’s functions.php as part of the theme setup. With the sole exception of the mobile menu that activates from the burger button (when the screen is small enough), every menu produced using WordPress’s wp_nav_menu() function will use the theme’s “walker”. (And even the exception isn’t really an exception : it’s just configured to use another of the theme’s “walkers”.)
Would it be possible to make this adjustment to accommodate 3rd party menu plugins such as this one?
You must be logged in to reply to this topic.