newuser_notify_siteadmin()

 

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 address: %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 (3.0.0)
	 *
	 * @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;
}

参数:newuser_notify_siteadmin( int $user_id )

筛选‘Newuser_notify_siteadmin’以更改通知电子邮件的内容。

The new user's ID.

(布尔)

$user_id

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

{acontent3}

You must log in before being able to contribute a note or feedback.

22.58% (7) 次Baidu访问
6.45% (2) 次Google访问
67.74% (21) 次Sogou访问
3.23% (1) 次sm访问
  • 蜘蛛:Baidu,7次,更新时间:2019-05-17 18:45:08
  • 蜘蛛:Google,2次,更新时间:2019-05-14 07:43:17
  • 蜘蛛:Sogou,21次,更新时间:2019-05-18 03:18:54
  • 蜘蛛:sm,1次,更新时间:2019-05-17 04:11:04

参与评论