[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 16:16:41 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:
---------------------------+----------------------
Comment (by kevinB):
> You're definitely not expected to do things like did_action( 'init' ) in
your code
@swissspidy Pods is not my code; I just pointed it out as an example. But
I will assert a Notice on your blanket statement about did_action('init')
based on consideration of my own case.
PublishPress Revisions filters the 'cron_schedules' filter, adding this
item to the array:
{{{#!php
<?php
$schedules['two_minutes'] = array(
'interval' => 120,
'display' => esc_html__( 'Every 2 Minutes', 'revisionary' );
);
}}}
This implementation conforms to wordpress.org
[https://developer.wordpress.org/reference/hooks/cron_schedules/
documentation for the cron_schedules filter].
Now I find that because another plugin calls wp_schedule_event() prior to
the the init action, Revisions is flagged with a notice for its proper
filtering of cron_schedules. How are we supposed to resolve this if
did_action( 'init' ) is bad form?
This also raises a question about your doing_it_wrong Notice strategy. The
wp-settings.php change causes another plugin's early wp_schedule_event()
to flag Revisions with a _load_textdomain_just_in_time Notice. Do you see
how this newly aggressive flagging has actually confused the situation by
blaming the wrong plugin? To avoid side effects like this, you would need
to apply a similar doing_it_wrong Notice to every function in the code
base that should not be called prior to 'init', as well as every action
and filter that should not be applied prior to 'init'. If not, would you
agree that it is understandable for plugins to begin wrapping their
translation strings in did_action( 'init' ) checks to avoid false
accusations which can lead to the very real consequence of negative
reviews?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/63185#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list