function newuser_notify_siteadmin( $user_id ) {}

Notifies the network admin that a new user has been activated.
Filter ‘newuser_notify_siteadmin’ to change the content of the notification email.


  • int $user_id: The new user’s ID.

Defined filters

  • newuser_notify_siteadmin
    apply_filters( 'newuser_notify_siteadmin', $msg )

Source code

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 = new WP_User($user_id);

	$options_site_url = esc_url(network_admin_url('settings.php'));

	$msg = sprintf(__('New User: %1s

Remote IP: %2s

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

	$msg = apply_filters( 'newuser_notify_siteadmin', $msg );

	wp_mail( $email, sprintf(__('New User Registration: %s'), $user->user_login), $msg );

	return true;



No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: