返回介绍

newuser_notify_siteadmin()

发布于 2017-09-11 02:02:09 字数 2498 浏览 1026 评论 0 收藏 0

newuser_notify_siteadmin( int $user_id )

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


description

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


参数

$user_id

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


返回值

(bool)


源代码

File: wp-includes/ms-functions.php

function newuser_notify_siteadmin( $user_id ) {
	if ( get_site_option( 'registrationnotification' ) != 'yes' )
		return false;

	$email = get_site_option( 'admin_email' );

	if ( is_email($email) == false )
		return false;

	$user = get_userdata( $user_id );

	$options_site_url = esc_url(network_admin_url('settings.php'));
	/* translators: New user notification email. 1: User login, 2: User IP address, 3: Settings screen URL */
	$msg = sprintf(__('New User: %1$s
Remote IP: %2$s

Disable these notifications: %3$s'), $user->user_login, wp_unslash( $_SERVER['REMOTE_ADDR'] ), $options_site_url);

	/**
	 * Filters the message body of the new user activation email sent
	 * to the network administrator.
	 *
	 * @since MU
	 *
	 * @param string  $msg  Email body.
	 * @param WP_User $user WP_User instance of the new user.
	 */
	$msg = apply_filters( 'newuser_notify_siteadmin', $msg, $user );
	wp_mail( $email, sprintf(__('New User Registration: %s'), $user->user_login), $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: get_userdata()
  • wp-includes/pluggable.php: wp_mail()
  • wp-includes/link-template.php: network_admin_url()
  • wp-includes/plugin.php: apply_filters()
  • wp-includes/option.php: get_site_option()
  • wp-includes/ms-functions.php: newuser_notify_siteadmin
  • Show 5 more uses Hide more uses

User Contributed Notes

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

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

发布评论

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