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.

git-svn-id: https://develop.svn.wordpress.org/trunk@57303 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Pascal Birchler
2024-01-17 14:30:47 +00:00
parent 935f4d1836
commit c399654df6

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;
}