do_action( 'wp_initialize_site',
$new_site,
$args );
// Only compute extra hook parameters if the deprecated hook is actually in use.
if ( has_action( 'wpmu_new_blog'
) ) { $user_id = !
empty( $args['user_id'
] ) ?
$args['user_id'
] : 0;
$meta = !
empty( $args['options'
] ) ?
$args['options'
] : array
();
// WPLANG was passed with `$meta` to the `wpmu_new_blog` hook prior to 5.1.0.
if ( !
array_key_exists( 'WPLANG',
$meta ) ) { $meta['WPLANG'
] =
get_network_option( $new_site->network_id, 'WPLANG'
);
} /*
* Rebuild the data expected by the `wpmu_new_blog` hook prior to 5.1.0 using allowed keys.
* The `$allowed_data_fields` matches the one used in `wpmu_create_blog()`.
*/
$allowed_data_fields = array
( 'public', 'archived', 'mature', 'spam', 'deleted', 'lang_id'
);
$meta =
array_merge( array_intersect_key( $data,
array_flip( $allowed_data_fields ) ),
$meta );
/**
* Fires immediately after a new site is created.
*
* @since MU (3.0.0)
* @deprecated 5.1.0 Use {@see 'wp_initialize_site'} instead.
*
* @param int $site_id Site ID.
* @param int $user_id User ID.
* @param string $domain Site domain.
* @param string $path Site path.
* @param int $network_id Network ID. Only relevant on multi-network installations.
* @param array $meta Meta data. Used to set initial site options.
*/