WordPress.org

Ready to get started?Download WordPress

Forums

Nav Menu Roles
[resolved] Fatal error (7 posts)

  1. Crandel
    Member
    Posted 1 year 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

    http://wordpress.org/extend/plugins/nav-menu-roles/

  2. helgatheviking
    Member
    Plugin Author

    Posted 1 year ago #

    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.

    edit:

    when stumped, turn to google. would you test out my version from github to see if this resolves your issue?
    https://github.com/helgatheviking/Nav-Menu-Roles/zipball/master

  3. Crandel
    Member
    Posted 1 year ago #

    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.

  4. helgatheviking
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  5. Crandel
    Member
    Posted 1 year ago #

    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.

  6. helgatheviking
    Member
    Plugin Author

    Posted 1 year ago #

    Good to know. But yeah, you cannot use multiple Walkers. You could, however, adjust your theme to mimic the role-checking in my plugin.

  7. helgatheviking
    Member
    Plugin Author

    Posted 1 year 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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic