I18N: Prevent PHP warning in `WP_Textdomain_Registry`.

Prevents a warning upon cache invalidation after language pack updates if the arguments don’t have the expected format.

Follow-up to [57287], [57290], [57298], [57299].

See #58919.
Built from https://develop.svn.wordpress.org/trunk@57303


git-svn-id: http://core.svn.wordpress.org/trunk@56809 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Pascal Birchler 2024-01-17 14:32:18 +00:00
parent b9638e6b00
commit e6a10d45e7
2 changed files with 6 additions and 2 deletions

View File

@ -228,7 +228,11 @@ class WP_Textdomain_Registry {
* @return void
*/
public function invalidate_mo_files_cache( $upgrader, $hook_extra ) {
if ( 'translation' !== $hook_extra['type'] || array() === $hook_extra['translations'] ) {
if (
! isset( $hook_extra['type'] ) ||
'translation' !== $hook_extra['type'] ||
array() === $hook_extra['translations']
) {
return;
}

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.5-alpha-57302';
$wp_version = '6.5-alpha-57303';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.