Skip to content

Don't perform translations too early #120

@bobbingwide

Description

@bobbingwide

When testing with WordPress 6.7-beta3 I started getting doing it wrong messages from _load_textdomain_just_in_time

Notice: Function _load_textdomain_just_in_time was called incorrectly. 
Translation loading for the oik-bwtrace 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](https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/) for more information. 
(This message was added in version 6.7.0.) 
in C:\apache\htdocs\bwcom\wp-includes\functions.php on line 6099

I analysed the problem here bobbingwide/bobbingwide#122 (comment)
And subsequently wrote a new comment to the WordPress TRAC here https://core.trac.wordpress.org/ticket/44937#comment:54

In this particular instance the fix is to avoid translations until after whatever hook it is after which it's safe to perform translations.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions