[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 00:45:10 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:  reopened
 Priority:  normal         |   Milestone:
Component:  I18N           |     Version:  trunk
 Severity:  normal         |  Resolution:
 Keywords:                 |     Focuses:
---------------------------+-----------------------
Changes (by kevinB):

 * status:  closed => reopened
 * resolution:  wontfix =>
 * component:  Administration => I18N


Comment:

 @swissspidy The WP 6.8 release has caused a long list of prominent plugins
 to be pegged with this "_load_textdomain_just_in_time was called
 incorrectly" notice. But in the case of Pods, I find that the problematic
 code is this addition to wp-settings.php:

 https://core.trac.wordpress.org/changeset?sfp_email=&sfph_mail=&reponame=&new=59461%40trunk%2Fsrc
 %2Fwp-settings.php&old=59132%40trunk%2Fsrc%2Fwp-settings.php

 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:

 {{{#!php
 <?php
 $plugin_data = get_plugin_data( $plugin, false, false );

 $textdomain = $plugin_data['TextDomain'];
 if ( $textdomain ) {
         if ( $plugin_data['DomainPath'] ) {
                 $GLOBALS['wp_textdomain_registry']->set_custom_path(
 $textdomain, dirname( $plugin ) . $plugin_data['DomainPath'] );
         } else {
                 $GLOBALS['wp_textdomain_registry']->set_custom_path(
 $textdomain, dirname( $plugin ) );
         }
 }
 }}}


 As a result, some plugin string initialization gets triggered by
 do_action('setup_theme') or downstream actions, leading to the
 _load_textdomain_just_in_time() notice.

 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.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/63185#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list