WordPress.org

Make WordPress Core

Opened 7 days ago

Closed 43 hours ago

#45932 closed defect (bug) (fixed)

Call wp_load_translations_early in WP_Shutdown_Handler

Reported by: spacedmonkey Owned by: flixos90
Milestone: 5.1 Priority: normal
Severity: normal Version: trunk
Component: Bootstrap/Load Keywords: servehappy has-patch
Focuses: multisite Cc:

Description (last modified by spacedmonkey)

It a PHP error handles extremely early in the bootstrap process, say in the wp-config.ph file, the WP_Shutdown_Handler will display an error message. This error message is run through the __ translation functions, but as the functions do not exist yet, these string fail to translated. Other parts of core, like wp-db class call the wp_load_translations_early function to fix this issue.

Attachments (1)

45932.diff (642 bytes) - added by spacedmonkey 3 days ago.

Download all attachments as: .zip

Change History (9)

#1 @spacedmonkey
7 days ago

  • Description modified (diff)

Related: #44458

This ticket was mentioned in Slack in #core-php by spacedmonkey. View the logs.


7 days ago

This ticket was mentioned in Slack in #core-php by schlessera. View the logs.


4 days ago

@spacedmonkey
3 days ago

#4 @spacedmonkey
3 days ago

  • Keywords has-patch added; needs-patch removed

Patch added.

#5 @pento
2 days ago

  • Milestone changed from Awaiting Review to 5.1

Adding to 5.1 milestone for consideration.

#6 @ocean90
2 days ago

Haven't looked in detail when this handler is called but if wp_load_translations_early() is available it should be used.

#7 @flixos90
44 hours ago

  • Keywords needs-testing removed
  • Owner set to flixos90
  • Status changed from new to reviewing

#8 @flixos90
43 hours ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 44622:

Bootstrap/Load: Use wp_load_translations_early() when Translation API is not yet loaded.

Props spacedmonkey.
Fixes #45932. See #44458.

Note: See TracTickets for help on using tickets.