Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
After updating the site to PHP 8.2, deprecation errors appeared on the front end related to dynamic properties in WPML_LS_Menu_Item.
Solution:
If you're experiencing similar issues, we recommend disabling the debug mode in WordPress to prevent these warnings from appearing to your visitors. You can do this by editing your wp-config.php file and ensuring it includes the following line:

define('WP_DEBUG_DISPLAY', false);

For more information on handling deprecated errors, please visit:

These notices are expected to be resolved in future updates. If this solution does not apply to your case, or if it seems outdated, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If issues persist, please open a new support ticket.

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Tagged: 

This topic contains 1 reply, has 2 voices.

Last updated by Mihai Apetrei 10 months, 2 weeks ago.

Assisted by: Mihai Apetrei.

Author Posts
July 23, 2024 at 8:21 pm #15994397

matthewC-39

<b>Background of the issue: </b>
I updated my site to PHP 8.2 and deprecation errors appeared on the front end of the site.

<b>Symptoms: </b>
Site throws these errors:

Deprecated: Creation of dynamic property WPML_LS_Menu_Item::$current is deprecated in /home/site/wwwroot/wp-includes/nav-menu-template.php on line 394

Deprecated: Creation of dynamic property WPML_LS_Menu_Item::$current is deprecated in /home/site/wwwroot/wp-includes/nav-menu-template.php on line 394

Deprecated: Creation of dynamic property WPML_LS_Menu_Item::$current_item_ancestor is deprecated in /home/site/wwwroot/wp-includes/nav-menu-template.php on line 540

Deprecated: Creation of dynamic property WPML_LS_Menu_Item::$current_item_parent is deprecated in /home/site/wwwroot/wp-includes/nav-menu-template.php on line 541

Deprecated: Creation of dynamic property WPML_LS_Menu_Item::$current_item_ancestor is deprecated in /home/site/wwwroot/wp-includes/nav-menu-template.php on line 540

Deprecated: Creation of dynamic property WPML_LS_Menu_Item::$current_item_parent is deprecated in /home/site/wwwroot/wp-includes/nav-menu-template.php on line 541

<b>Questions: </b>
I know a few errors have been fixed with version 4.6.12, but these ones still remain.

July 23, 2024 at 8:28 pm #15994511

Mihai Apetrei
WPML Supporter since 03/2018

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hi there.


In regards to the deprecated notices, these PHP versions are relatively new versions and not yet fully compatible with WPML.

However, I noticed that the messages showing up in the log are just warnings about deprecated functions that will require modification soon.

Nevertheless, these functions are still operational.

To avoid showing your visitors unwanted warnings and errors, it's best to disable the debug mode in WordPress. This is actually a recommended practice, so you won't have to worry.

To achieve that, edit your wp-config.php file and make sure it has this line

define( 'WP_DEBUG_DISPLAY', false );

Please take a look here in regards to deprecated errors in general:
https://wpml.org/errata/php-8-2-deprecated-creation-of-dynamic-property-whip_requirementscheckerconfiguration-is-deprecated/

Please also take a look at the explanation from the official WordPress.org website:
https://make.wordpress.org/core/2022/01/10/wordpress-5-9-and-php-8-0-8-1/

These notices will go away in future updates (as you mentioned, we took care of some of them but there are still others) but for now, if you want to hide them from visitors, you can set that value to "false".

I hope that you will find all this information helpful.

Mihai Apetrei