After updating to WordPress 6.7, I’m receiving the following PHP notice on my website. How can I resolve this issue?
Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the blahblah domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /wp-includes/functions.php on line 6114
2
Answers
If You're a Website Owner
Translation loading for the blahblah domain.
If You're a Plugin / Theme Author
Check your textdomain registration code and make sure the function is set to
init
hook or later. By textdomain registration code I mean the load_textdomain, load_plugin_textdomain, or load_theme_textdomain functions.For example the following code is wrong and should get fixed.
The following code is the correct one:
Lots of plugins are seeing this error NOT caused by incorrect text domain loading, but by other WordPress functions.
My plugin was using ‘get_plugin_data’ and getting was this error. I am still seeing it for other WP functions.
I replaced ‘get_plugin_data’ with
as a workaround.
But major plugins such as woocommerce (8 million installations)and really simple security (4 million installations) are seeing issues, and I gather it has been raised for a WP fix, rather than forcing plugin authors to work round it.
https://developer.woocommerce.com/2024/11/11/developer-advisory-translation-loading-changes-in-wordpress-6-7/