返回介绍

newblog_notify_siteadmin()

发布于 2017-09-11 02:01:54 字数 2829 浏览 1122 评论 0 收藏 0

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

Notifies the network admin that a new site has been activated.


description

Filter ‘newblog_notify_siteadmin’ to change the content of the notification email.


参数

$blog_id

(int) (Required) The new site's ID.

$deprecated

(string) (Optional) Not used.

Default value: ''


返回值

(bool)


源代码

File: wp-includes/ms-functions.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: %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
	 *
	 * @param string $msg Email body.
	 */
	$msg = apply_filters( 'newblog_notify_siteadmin', $msg );

	wp_mail( $email, sprintf( __( 'New Site Registration: %s' ), $siteurl ), $msg );
	return true;
}

更新日志

Versiondescription
MUIntroduced.

相关函数

Uses

  • wp-includes/l10n.php: __()
  • wp-includes/formatting.php: wp_unslash()
  • wp-includes/formatting.php: esc_url()
  • wp-includes/formatting.php: is_email()
  • wp-includes/pluggable.php: wp_mail()
  • wp-includes/link-template.php: network_admin_url()
  • wp-includes/link-template.php: site_url()
  • wp-includes/plugin.php: apply_filters()
  • wp-includes/option.php: get_site_option()
  • wp-includes/option.php: get_option()
  • wp-includes/ms-functions.php: newblog_notify_siteadmin
  • wp-includes/ms-blogs.php: switch_to_blog()
  • wp-includes/ms-blogs.php: restore_current_blog()
  • Show 8 more uses Hide more uses

User Contributed Notes

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文