Making compatible with Nav Menu Roles
-
James,
I haven’t had any direct support queries come through regarding incompatibility between your plugin and mine (Nav Menu Roles), but I was stumbling around the internet and came across your plugin.
When I saw the screenshot, I suspected you were filtering the admin nav menu walker, and you are:
add_filter( 'wp_edit_nav_menu_walker', array($this, 'set_edit_walker'));
And now in your support forums I see the same type of posts that I get about how it won’t work with XYZ theme. Themes shouldn’t be filtering this at all, imo, but I digress.
WordPress core has been languishing for years to solve this problem and add proper hooks, so someone else came up with the idea to add it ourselves. You can see what I mean in my FAQ, specifically Workaround 1. Basically in your walker you duplicate the WP walker and only add the same hook that a few of us with menu plugins are using. Then add your menu fields to that hook. That way our plugins (and supporting themes) will work together.
This does maybe put people with large menus at risk of hitting the $_POST limit, which is the original reason a hook was refused in core. But, that’s a different can of worms and the action hook helps reduce the amount of support requests I receive about non-compatible themes.
Cheers,
-Kathy
- The topic ‘Making compatible with Nav Menu Roles’ is closed to new replies.