Make WordPress Core

Opened 4 weeks ago

Closed 4 weeks ago

Last modified 4 weeks ago

#62237 closed defect (bug) (fixed)

Bundled Themes: avoid triggering translation loading too early

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

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
4 weeks ago

  • Keywords has-patch added; needs-patch removed
  • Milestone changed from Awaiting Review to 6.7

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

#3 @swissspidy
4 weeks ago

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

#4 @swissspidy
4 weeks ago

  • Keywords commit added

#5 @domainsupport
4 weeks ago

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

#6 @swissspidy
4 weeks ago

No problem, I just updated the PR accordingly.

#7 @peterwilsoncc
4 weeks ago

  • Owner set to peterwilsoncc
  • Resolution set to fixed
  • Status changed from new to closed

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.