• Resolved Jatin Rathod

    (@jatinrathod)


    Hello,
    I am using multilingualpress for one of my multisite with enfold theme and i am getting
    Catchable fatal error: Argument 1 passed to Mlp_Nav_Menu_Frontend::filter_items() must be of the type array, null given in /wp-content/plugins/multilingual-press/inc/nav-menu/Mlp_Nav_Menu_Frontend.php on line 42
    this error in french version site instead of menu items

    Please help me to resolve this issue.

    https://www.ads-software.com/plugins/multilingual-press/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter Jatin Rathod

    (@jatinrathod)

    I managed to work around this.

    VanW

    (@vanw)

    Hello Jatin,
    can you please share how did you worked around the issue?
    I ran into same issue, basically whenewer I add custom menu to primary arrea I get:

    Catchable fatal error: Argument 1 passed to Mlp_Nav_Menu_Frontend::prepare_item() must be an instance of WP_Post, instance of theme_MenuItem given, called in /www/doc/www.vazbalegal.cz/www/web/wp-content/plugins/multilingual-press/inc/nav-menu/Mlp_Nav_Menu_Frontend.php on line 54 and defined in /www/doc/www.vazbalegal.cz/www/web/wp-content/plugins/multilingual-press/inc/nav-menu/Mlp_Nav_Menu_Frontend.php on line 66

    Thank you

    Van

    Plugin Author Frank Bueltge

    (@bueltge)

    @vanw.
    This message is from a newer version of MLP.
    Remove the widget, save sidebar, add the widget again, set your settings and the warning is done, the changes was saved in the database.

    Well, no, the problem here is most likely that you are using a theme that in turn uses a custom class with the name theme_MenuItem (there seem to be a lot of themes that do this) that is no extension to the default WP_Post class.

    One way to get rid of the fatal error is that we don’t use WP_Post for type hinting our parameter. I first have to check what could go wrong then, though, if anything.

    Can you confirm that you indeed use a theme that comes with a theme_MenuItem class?

    And by the way, please open a new topic next time. Even though it is a problem related to the Mlp_Nav_Menu_Frontend class, too, this is a different problem.

    Plugin Author Frank Bueltge

    (@bueltge)

    Thanks @tf for enhancement.

    I haven’t got read the message, the important part instance of theme_MenuItem given.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Got Error in Mlp_Nav_Menu_Frontend.php’ is closed to new replies.