通知网络管理员已激活新站点。

原型

newblog_notify_siteadmin( int $blog_id, string $deprecated = '' )

描述

过滤“newblog_notify_siteadmin”以更改通知电子邮件的内容。

参数

$blog_id (int) (Required) 新网站的ID。

$deprecated (string) (Optional) 不曾用过。

返回值

(bool)  

源文件

路径:wp-includes/ms-functions.php

<?php
...
function newblog_notify_siteadmin( $blog_id, $deprecated = '' ) {
	if ( get_site_option( 'registrationnotification' ) != 'yes' )
		return false;
	$email = get_site_option( 'admin_email' );
	if ( is_email($email) == false )
		return false;
	$options_site_url = esc_url(network_admin_url('settings.php'));
	switch_to_blog( $blog_id );
	$blogname = get_option( 'blogname' );
	$siteurl = site_url();
	restore_current_blog();
	/* translators: New site notification email. 1: Site URL, 2: User IP address, 3: Settings screen URL */
	$msg = sprintf( __( 'New Site: %1$s
URL: %2$s
Remote IP address: %3$s
Disable these notifications: %4$s' ), $blogname, $siteurl, wp_unslash( $_SERVER['REMOTE_ADDR'] ), $options_site_url);
	/**
	 * Filters the message body of the new site activation email sent
	 * to the network administrator.
	 *
	 * @since MU (3.0.0)
	 *
	 * @param string $msg Email body.
	 */
	$msg = apply_filters( 'newblog_notify_siteadmin', $msg );
	wp_mail( $email, sprintf( __( 'New Site Registration: %s' ), $siteurl ), $msg );
	return true;
}
...
?>

其他

英文文档:https://developer.wordpress.org/reference/functions/newblog_notify_siteadmin/