[wp-trac] [WordPress Trac] #62462: Revert _doing_it_wrong warning when loading translations early

WordPress Trac noreply at wordpress.org
Fri Nov 22 14:02:55 UTC 2024


#62462: Revert _doing_it_wrong warning when loading translations early
-------------------------------+---------------------
 Reporter:  TimothyBlynJacobs  |       Owner:  (none)
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  6.7.2
Component:  I18N               |     Version:  6.7
 Severity:  normal             |  Resolution:
 Keywords:                     |     Focuses:
-------------------------------+---------------------

Comment (by brianhogg):

 One potential case for reverting is the scheduling of jobs via
 `wp_schedule_event`. This often happens before `init` via `plugins_loaded`
 or even within a `register_activation_hook`. The scheduling causes the
 `cron_schedules` filter to fire, and those schedules have the `display`
 value which is usually translatable (ie. `__( 'Every %s minutes',
 'textdomain')`.

 I'm not seeing a good workaround for this other than making the schedule
 `display` string english-only, or else moving the scheduling of the event
 to something after `init` and needing to do a `wp_next_scheduled` check or
 transient check every page load (instead of once via
 `register_activation_hook`).

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


More information about the wp-trac mailing list