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.
<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.
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
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.