[wp-trac] [WordPress Trac] #63185: Function _load_textdomain_just_in_time was called incorrectly in WP v6.8-RC1
WordPress Trac
noreply at wordpress.org
Tue Apr 22 09:22:18 UTC 2025
#63185: Function _load_textdomain_just_in_time was called incorrectly in WP
v6.8-RC1
---------------------------+----------------------
Reporter: jorgedelcampo | Owner: (none)
Type: defect (bug) | Status: closed
Priority: normal | Milestone:
Component: I18N | Version: trunk
Severity: normal | Resolution: wontfix
Keywords: | Focuses:
---------------------------+----------------------
Changes (by swissspidy):
* status: reopened => closed
* resolution: => wontfix
Comment:
> The plugin is not calling `load_textdomain()` early. Instead, its
textdomain is being auto-registered early by `wp-settings.php` based on
the plugin file's "Text Domain" tag
> Can you explain what's going on here and detail the new implications and
requirements for plugins? It seems like the plugins are being called out
for textdomain loading they're not responsible for.
This `_doing_it_wrong` notice is not about calling `load_textdomain()`
specifically. It's about triggering ''translation loading'', for example
by calling `__()`, too early.
While this message was already introduced in 6.7, there were some edge
cases where it didn't fire. In 6.8 that's not the case anymore thanks to
that `wp-settings.php` change.
> Is this an intentional move to flush out the mistimed plugin translation
calls?
Yes. Again, see https://make.wordpress.org/core/2024/10/21/i18n-
improvements-6-7/ and https://make.wordpress.org/core/2025/03/12/i18n-
improvements-6-8/. They contain some good examples and explanation why
loading translations too early is bad.
-----
If you have a plugin doing it wrong in the repo or on GitHub, I am happy
to take a look and point out why it might happen in your case.
You're definitely not expected to do things like `did_action( 'init' )` in
your code à la https://github.com/pods-
framework/pods/pull/7398/commits/7b93ffdb353183f3713cf3fc9751deb13f8d6cdc.
That could just make things worse by unintentionally removing any user-
facing texts. Instead you should figure out why your whole code is loaded
too early and what you can do to avoid that.
-----
PS. There is no reason to reopen the ticket. Discussions can continue even
on closed tickets. So let's do that please :)
--
Ticket URL: <https://core.trac.wordpress.org/ticket/63185#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list