newuser_notify_siteadmin

The timeline below displays how wordpress function newuser_notify_siteadmin has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 5.5

/**
 * Notifies the network admin that a new user has been activated.
 *
 * Filter {@see 'newuser_notify_siteadmin'} to change the content of
 * the notification email.
 *
 * @since MU (3.0.0)
 *
 * @param int $user_id The new user's ID.
 * @return bool
 */
function newuser_notify_siteadmin($user_id)
{
    if ('yes' !== get_site_option('registrationnotification')) {
        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'));
    $msg = sprintf(
        /* translators: New user notification email. 1: User login, 2: User IP address, 3: URL to Network Settings screen. */
        __('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);
    /* translators: New user notification email subject. %s: User login. */
    wp_mail($email, sprintf(__('New User Registration: %s'), $user->user_login), $msg);
    return true;
}

WordPress Version: 5.3

/**
 * Notifies the network admin that a new user has been activated.
 *
 * Filter {@see 'newuser_notify_siteadmin'} to change the content of
 * the notification email.
 *
 * @since MU (3.0.0)
 *
 * @param int $user_id The new user's ID.
 * @return bool
 */
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'));
    $msg = sprintf(
        /* translators: New user notification email. 1: User login, 2: User IP address, 3: URL to Network Settings screen. */
        __('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);
    /* translators: New user notification email subject. %s: User login. */
    wp_mail($email, sprintf(__('New User Registration: %s'), $user->user_login), $msg);
    return true;
}

WordPress Version: 4.9

/**
 * Notifies the network admin that a new user has been activated.
 *
 * Filter {@see 'newuser_notify_siteadmin'} to change the content of
 * the notification email.
 *
 * @since MU (3.0.0)
 *
 * @param int $user_id The new user's ID.
 * @return bool
 */
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;
}

WordPress Version: 4.7

/**
 * Notifies the network admin that a new user has been activated.
 *
 * Filter {@see 'newuser_notify_siteadmin'} to change the content of
 * the notification email.
 *
 * @since MU
 *
 * @param int $user_id The new user's ID.
 * @return bool
 */
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;
}

WordPress Version: 4.6

/**
 * Notifies the network admin that a new user has been activated.
 *
 * Filter {@see 'newuser_notify_siteadmin'} to change the content of
 * the notification email.
 *
 * @since MU
 *
 * @param int $user_id The new user's ID.
 * @return bool
 */
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'));
    $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;
}

WordPress Version: 4.1

/**
 * Notifies the network admin that a new user has been activated.
 *
 * Filter 'newuser_notify_siteadmin' to change the content of
 * the notification email.
 *
 * @since MU
 *
 * @param int $user_id The new user's ID.
 * @return bool
 */
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'));
    $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);
    /**
     * Filter 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;
}

WordPress Version: 3.8

/**
 * Notifies the network admin that a new user has been activated.
 *
 * Filter 'newuser_notify_siteadmin' to change the content of
 * the notification email.
 *
 * @since MU
 * @uses apply_filters() Filter newuser_notify_siteadmin to change the content of the email message
 *
 * @param int $user_id The new user's ID.
 * @return bool
 */
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'));
    $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);
    /**
     * Filter 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;
}

WordPress Version: 3.7

/**
 * Notifies the network admin that a new user has been activated.
 *
 * Filter 'newuser_notify_siteadmin' to change the content of
 * the notification email.
 *
 * @since MU
 * @uses apply_filters() Filter newuser_notify_siteadmin to change the content of the email message
 *
 * @param int $user_id The new user's ID.
 * @return bool
 */
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'));
    $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);
    $msg = apply_filters('newuser_notify_siteadmin', $msg, $user);
    wp_mail($email, sprintf(__('New User Registration: %s'), $user->user_login), $msg);
    return true;
}