[wp-trac] [WordPress Trac] #64401: Function _load_textdomain_just_in_time was called incorrectly

WordPress Trac noreply at wordpress.org
Thu Dec 11 09:40:13 UTC 2025


#64401: Function _load_textdomain_just_in_time was called incorrectly
--------------------------+-----------------------------
 Reporter:  arifursdev    |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Plugins       |    Version:  6.9
 Severity:  major         |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Hello, in my plugin, despite loading the textdomain on `init` action

 {{{#!php
 <?php

 add_action( 'init', [$this, 'load_text_domain'] );

 public static function load_text_domain() {
     load_plugin_textdomain( 'TOLS_ACTIVITY_MANAGER', false, dirname(
 dirname( plugin_basename( __FILE__ ) ) ) . '/languages/' );
 }

 }}}


 I keep on getting the notice in `wp-content/debug.log` file.


 {{{
 [10-Dec-2025 08:39:57 UTC] PHP Notice:  Function
 _load_textdomain_just_in_time was called <strong>incorrectly</strong>.
 Translation loading for the <code>TOLS_ACTIVITY_MANAGER</code> 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
 <code>init</code> action or later. Please see <a
 href="https://developer.wordpress.org/advanced-administration/debug/debug-
 wordpress/">Debugging in WordPress</a> for more information. (This message
 was added in version 6.7.0.) in D:\xampp\htdocs\wp_quickstart\wp-
 includes\functions.php on line 6131
 }}}

 and I cannot tell which version, but recently it seems after the WordPress
 updates, it has become impossible to stop notices or control which errors
 should be put to `debug.log` file. despite doing this in `wp-config.php`
 file, it keeps on logging PHP Notices. even edited the `php.ini` file
 locally, error reporting on the hosting level, it just keeps on logging.

 {{{#!php
 <?php
 define( 'WP_DEBUG', true );
 define( 'WP_DEBUG_LOG', true );
 define( 'WP_DEBUG_DISPLAY', false );
 ini_set('display_errors', 'off');
 error_reporting( E_ALL & ~E_NOTICE );
 }}}

 Currently I'm using the latest version (6.9)

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/64401>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list