Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#62237 closed defect (bug) (fixed)

Bundled Themes: avoid triggering translation loading too early

Reported by: domainsupport Owned by: peterwilsoncc
Priority: normal Milestone: 6.7
Component: Bundled Theme Version: 6.7
Severity: normal Keywords: has-patch commit
Cc: Focuses:

Description

As per #44937 we are seeing this error notice with Twenty Twenty bundled theme when testing with WordPress v6.7-beta3 ...

[16-Oct-2024 11:08:39 UTC] E_USER_NOTICE: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the twentytwenty 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 init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /wp-includes/functions.php on line 6099

We are also seeing similar notices with Twenty Seventeen and Twenty Nineteen. Do they require additional tickets or can all be dealt with in this ticket?

Oliver

Change History (8)

#1 @swissspidy
2 years ago

  • Keywords has-patch added; needs-patch removed
  • Milestone Awaiting Review6.7

Good catch! We can fix this all in the same ticket.

#3 @swissspidy
2 years ago

  • Summary Twenty Twenty: "Translation loading for the twentytwenty domain was triggered too early"Bundled Themes: avoid triggering translation loading too early

#4 @swissspidy
2 years ago

  • Keywords commit added

#5 @domainsupport
2 years ago

Ah, sorry, just spotted the same in Twenty Fifteen, Twenty Sixteen, Twenty Ten, Twenty Thirteen, Twenty Twelve and Twenty Fourteen!

#6 @swissspidy
2 years ago

No problem, I just updated the PR accordingly.

#7 @peterwilsoncc
2 years ago

  • Owner set to peterwilsoncc
  • Resolutionfixed
  • Status newclosed

In 59244:

Bundled Themes: Avoid loading translations too early.

Load block patterns for bundled themes on the init hook to avoid triggering notices caused by loading the translations too early.

The change is applied to Twenty Ten, Twenty Twelve, Twenty Thirteen, Twenty Fourteen, Twenty Fifteen, Twenty Sixteen and Twenty Twenty.

Props domainsupport, swissspidy.
Fixes #62237.
See #44937.

Note: See TracTickets for help on using tickets.