send_new_site_email filter-hookWP 5.6.0

Filters whether to send an email to the Multisite network administrator when a new site is created.

Return false to disable sending the email.

Usage

add_filter( 'send_new_site_email', 'wp_kama_send_new_site_email_filter', 10, 3 );

/**
 * Function for `send_new_site_email` filter-hook.
 * 
 * @param bool    $send Whether to send the email.
 * @param WP_Site $site Site object of the new site.
 * @param WP_User $user User object of the administrator of the new site.
 *
 * @return bool
 */
function wp_kama_send_new_site_email_filter( $send, $site, $user ){

	// filter...
	return $send;
}
$send(true|false)
Whether to send the email.
$site(WP_Site)
Site object of the new site.
$user(WP_User)
User object of the administrator of the new site.

Changelog

Since 5.6.0 Introduced.

Where the hook is called

wpmu_new_site_admin_notification()
send_new_site_email
wp-includes/ms-functions.php 1735
if ( ! apply_filters( 'send_new_site_email', true, $site, $user ) ) {

Where the hook is used in WordPress

Usage not found.