Warning: include_once(/home/favoledo/robertozanardo.com/wp-content/sunrise.php): Failed to open stream: No such file or directory in /home/favoledo/robertozanardo.com/wp-includes/ms-settings.php on line 52

Warning: include_once(): Failed opening '/home/favoledo/robertozanardo.com/wp-content/sunrise.php' for inclusion (include_path='.:/opt/alt/php83/usr/share/pear:/opt/alt/php83/usr/share/php:/usr/share/pear:/usr/share/php') in /home/favoledo/robertozanardo.com/wp-includes/ms-settings.php on line 52
Workaround to walk function no more compatible with Walker in Wordpress 5.3 - Odoo e Soluzioni Open Source

Workaround to walk function no more compatible with Walker in WordPress 5.3

With te latest releases of WordPress, after updating to WP 5.3 it’s common to receive this error on some custom themes:

Warning: Declaration of _Nav_Menu::walk($elements, $max_depth) should be compatible with Walker::walk($elements, $max_depth, …$args) in…

This is caused by the introduction of the spread operator, as per official WordPress release note:

In WordPress 5.3, the PHP 5.6 spread operator has been introduced to WordPress in a number of places.

Using the spread operator allowed for simplifying the code and improves performance – both in speed as well as memory use -, especially as it has been introduced in a number of functions which are used a multitude of times during every single pageload, such as current_user_can() and add_query_arg().

Most plugins and themes should see no impact of these patches, other than the improved performance.

However, if your plugin/theme is impacted, you will need to take action.

In the file function.php we can use a workaround to adapt the Walk function and change it from:

function walk ($items, $depth) {

                    $this->elements = $this->get_number_of_root_elements($items);

                    return parent::walk($items, $depth);

                }

To:

function walk ($items, $depth,...$args) {

                    $this->elements = $this->get_number_of_root_elements($items);

                    return parent::walk($items, $depth,...$args);

                }

Hope this helps someone with the same problem, feel free to comment below!

Roberto

Lascia un commento

kolaybet giriş
kolaybet
betgaranti
bettilt
kolaybet
betpark
betgaranti
betpark
betgaranti
kolaybet
kolaybet
betpark
betpark
betgaranti
hellocasino
betgaranti
Kolaybet
Kolaybet Mobil Giriş
bettilt
betpark
betpark
Kolaybet
Kolaybet Giriş
Kolaybet
betpark
betpark
kolaybet
betpark
betgaranti
kolaybet giriş
kolaybet
kolaybet mobil giriş
Kolaybet Giriş
Kolaybet
Kolaybet Telegram
Kolaybet Resmi Giriş
Kolaybet Giriş
Kolaybet 2026
betpark
betpark
holiganbet
Kolaybet
Kolaybet
Betgaranti
matbet güncel giriş
matbet güncel giriş
matbet güncel giriş
matbet güncel giriş
betgaranti
betgaranti
betgaranti
sahabet
sahabet
kolaybet
kolaybet
sahabet
Hititbet
Hititbet Giriş
sahabet
Hititbet Güncel Giriş
vdcasino
onwin
onwin
hititbet
betgaranti
Hellocasino
Hello Casino
Hititbet
Hititbet 2026
Hititbet Güncel Giriş
Hititbet
Hititbet Güncel Giriş
hititbet
vdcasino
onwin
onwin
grandpashabet
betpark
betgaranti
hititbet
grandpashabet