Support » Plugins and Hacks » [Resolved] [Plugin: Nav Menu Roles] Fatal error
4 years ago
Hi, very interesting plug-in.
But when I activate the plug-in, I get following error on my page:
Fatal error: Call-time pass-by-reference has been removed in …\wp-content\plugins\nav-menu-roles\inc\class.Nav_Menu_Role_Walker.php on line 39
What version of PHP are you using? What version of WP? Does this still happen if you disable other plugins? I cannot duplicate this locally or live, so I’m a bit stumped.
when stumped, turn to google. would you test out my version from github to see if this resolves your issue?
Hi, I resolve bug removing the & from &$output in the two lines:
parent::start_el( &$output, $item, $depth, $args );
Anyway, I change the code because I have conflict with my theme. The theme add ‘wp_nav_menu_args’ filter too.
Then I lose all menu format.
What I do is remove the ‘wp_nav_menu_args’ filter and register to ‘walker_nav_menu_start_el’.
And all work good.
Ok, that’s what I did to fix the bug too. I will push the update out to WordPress as soon as possible.
Does your theme use a custom Walker with wp_nav_menu_args ? Because otherwise the $args should just be merged.
Yes, it does.
This problem occurs not only with your plugin, I saw same conflict with all plugins that manipulate menu.
With yours, I understanding the problem.
Good to know. But yeah, you cannot use multiple Walkers. You could, however, adjust your theme to mimic the role-checking in my plugin.
3 years, 11 months ago
please check out the 1.2 update. It uses an alternative method of restricting the menu items and will no longer conflict with a theme or plugin’s custom nav Walker.