I’m currently working on a WordPress site and whenever in the admin I go the Appearance > Menus page I get the following error:
ErrorException: Runtime Notice: Declaration of Walker_Nav_Menu_Edit::start_lvl() should be compatible with that of Walker_Nav_Menu::start_lvl() in wp-admin/includes/nav-menu.php line 203
It seems like some sort of PHP compatibility issue. I’m running PHP 5.3.10 on my local dev machine.
What would be the best way to remedy this problem?
From
class Walker_Nav_Menu
:Your child class must use the same signature: three arguments, the first one passed by reference. Every difference will raise the error you got.
Note that
$args
defaults to an empty array, but you get an instance ofstdClass
, not an array. This is WordPress.From class
Walker_Nav_Menu
replace this linesto
to
to
to
This was the same in my case. You get old nav menu walker codes, and it says what you should do when you turn on wp_debug(true)
Menu_Frontend::start_lvl(&$output, $depth) should be compatible with Walker_Nav_Menu::start_lvl(&$output, $depth = 0, $args = NULL) in C:xampphtdocsshopnetwp-contentthemesViteeohades_frameworkhelpermegamenu.php on line 314
As you can see you need to change some code line what PHP refers to you. In above error notice you should replace start_lvl(&$output, $depth) with start_lvl(&$output, $depth = 0, $args = NULL)
so other processes are the same. But don’t forget to write function opening tag { at the end, like this NULL) {