new_site_email filter-hookWP 5.6.0

Filters the content of the email sent to the Multisite network administrator when a new site is created.

Content should be formatted for transmission via wp_mail().

Usage

add_filter( 'new_site_email', 'wp_kama_new_site_email_filter', 10, 3 );

/**
 * Function for `new_site_email` filter-hook.
 * 
 * @param array   $new_site_email Used to build wp_mail().
 * @param WP_Site $site           Site object of the new site.
 * @param WP_User $user           User object of the administrator of the new site.
 *
 * @return array
 */
function wp_kama_new_site_email_filter( $new_site_email, $site, $user ){

	// filter...
	return $new_site_email;
}
$new_site_email(array)

Used to build wp_mail().

  • to(string)
    The email address of the recipient.

  • subject(string)
    The subject of the email.

  • message(string)
    The content of the email.

  • headers(string)
    Headers.
$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()
new_site_email
wp-includes/ms-functions.php 1791
$new_site_email = apply_filters( 'new_site_email', $new_site_email, $site, $user );

Where the hook is used in WordPress

Usage not found.