diff --git a/src/wp-includes/ms-site.php b/src/wp-includes/ms-site.php index b7a14c47f8..920e5d8b37 100644 --- a/src/wp-includes/ms-site.php +++ b/src/wp-includes/ms-site.php @@ -107,7 +107,7 @@ function wp_insert_site( array $data ) { // Rebuild the data expected by the `wpmu_new_blog` hook prior to 5.1.0 using whitelisted keys. // The `$site_data_whitelist` matches the one used in `wpmu_create_blog()`. $site_data_whitelist = array( 'public', 'archived', 'mature', 'spam', 'deleted', 'lang_id' ); - $meta = array_merge( array_intersect_key( $data, array_flip( $site_data_whitelist ) ), $meta ); + $meta = array_merge( array_intersect_key( $data, array_flip( $site_data_whitelist ) ), $meta ); /** * Fires immediately after a new site is created. diff --git a/tests/phpunit/tests/multisite/site.php b/tests/phpunit/tests/multisite/site.php index ff785c0a0a..9b53df1709 100644 --- a/tests/phpunit/tests/multisite/site.php +++ b/tests/phpunit/tests/multisite/site.php @@ -2379,8 +2379,7 @@ if ( is_multisite() ) : public function data_wpmu_new_blog_action_backward_commpatible() { return array( 'default values' => array( - array( - ), + array(), array( 'public' => 0, // `public` is one of the defaults metas in `wpmu_create_blog' function prior WordPress 5.1.0 'WPLANG' => 'en_US', // WPLANG is another default meta in `wpmu_create_blog` function prior WordPress 5.1.0. @@ -2392,7 +2391,7 @@ if ( is_multisite() ) : ), array( 'public' => 1, - 'WPLANG' => 'en_US' + 'WPLANG' => 'en_US', ), ), 'all whitelisted' => array(