wp_initialize_site action-hookWP 5.1.0

Fires when a site's initialization routine should be executed.

Usage

add_action( 'wp_initialize_site', 'wp_kama_initialize_site_action', 10, 2 );

/**
 * Function for `wp_initialize_site` action-hook.
 * 
 * @param WP_Site $new_site New site object.
 * @param array   $args     Arguments for the initialization.
 *
 * @return void
 */
function wp_kama_initialize_site_action( $new_site, $args ){

	// action...
}
$new_site(WP_Site)
New site object.
$args(array)
Arguments for the initialization.

Changelog

Since 5.1.0 Introduced.

Where the hook is called

wp_insert_site()
wp_initialize_site
wp-includes/ms-site.php 105
do_action( 'wp_initialize_site', $new_site, $args );

Where the hook is used in WordPress

wp-includes/ms-default-filters.php 51
add_action( 'wp_initialize_site', 'wp_initialize_site', 10, 2 );
wp-includes/ms-default-filters.php 52
add_action( 'wp_initialize_site', 'wpmu_log_new_registrations', 100, 2 );
wp-includes/ms-default-filters.php 53
add_action( 'wp_initialize_site', 'newblog_notify_siteadmin', 100, 1 );