send_new_site_email
Filters whether to send an email to the Multisite network administrator when a new site is created.
Return false to disable sending the email.
Использование
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.
Список изменений
| С версии 5.6.0 | Введена. |
Где вызывается хук
send_new_site_email
wp-includes/ms-functions.php 1782
if ( ! apply_filters( 'send_new_site_email', true, $site, $user ) ) {