newblog_notify_siteadmin

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

WordPress Version: 5.9

/**
 * Notifies the network admin that a new site has been activated.
 *
 * Filter {@see 'newblog_notify_siteadmin'} to change the content of
 * the notification email.
 *
 * @since MU (3.0.0)
 * @since 5.1.0 $blog_id now supports input from the {@see 'wp_initialize_site'} action.
 *
 * @param WP_Site|int $blog_id    The new site's object or ID.
 * @param string      $deprecated Not used.
 * @return bool
 */
function newblog_notify_siteadmin($blog_id, $deprecated = '')
{
    if (is_object($blog_id)) {
        $blog_id = $blog_id->blog_id;
    }
    if ('yes' !== get_site_option('registrationnotification')) {
        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();
    $msg = sprintf(
        /* translators: New site notification email. 1: Site URL, 2: User IP address, 3: URL to Network Settings screen. */
        __('New Site: %1$s
URL: %2$s
Remote IP address: %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 (3.0.0)
     * @since 5.4.0 The `$blog_id` parameter was added.
     *
     * @param string     $msg     Email body.
     * @param int|string $blog_id The new site's ID as an integer or numeric string.
     */
    $msg = apply_filters('newblog_notify_siteadmin', $msg, $blog_id);
    /* translators: New site notification email subject. %s: New site URL. */
    wp_mail($email, sprintf(__('New Site Registration: %s'), $siteurl), $msg);
    return true;
}

WordPress Version: 5.5

/**
 * Notifies the network admin that a new site has been activated.
 *
 * Filter {@see 'newblog_notify_siteadmin'} to change the content of
 * the notification email.
 *
 * @since MU (3.0.0)
 * @since 5.1.0 $blog_id now supports input from the {@see 'wp_initialize_site'} action.
 *
 * @param WP_Site|int $blog_id    The new site's object or ID.
 * @param string      $deprecated Not used.
 * @return bool
 */
function newblog_notify_siteadmin($blog_id, $deprecated = '')
{
    if (is_object($blog_id)) {
        $blog_id = $blog_id->blog_id;
    }
    if ('yes' !== get_site_option('registrationnotification')) {
        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();
    $msg = sprintf(
        /* translators: New site notification email. 1: Site URL, 2: User IP address, 3: URL to Network Settings screen. */
        __('New Site: %1$s
URL: %2$s
Remote IP address: %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 (3.0.0)
     * @since 5.4.0 The `$blog_id` parameter was added.
     *
     * @param string $msg     Email body.
     * @param int    $blog_id The new site's ID.
     */
    $msg = apply_filters('newblog_notify_siteadmin', $msg, $blog_id);
    /* translators: New site notification email subject. %s: New site URL. */
    wp_mail($email, sprintf(__('New Site Registration: %s'), $siteurl), $msg);
    return true;
}

WordPress Version: 5.4

/**
 * Notifies the network admin that a new site has been activated.
 *
 * Filter {@see 'newblog_notify_siteadmin'} to change the content of
 * the notification email.
 *
 * @since MU (3.0.0)
 * @since 5.1.0 $blog_id now supports input from the {@see 'wp_initialize_site'} action.
 *
 * @param WP_Site|int $blog_id    The new site's object or ID.
 * @param string      $deprecated Not used.
 * @return bool
 */
function newblog_notify_siteadmin($blog_id, $deprecated = '')
{
    if (is_object($blog_id)) {
        $blog_id = $blog_id->blog_id;
    }
    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();
    $msg = sprintf(
        /* translators: New site notification email. 1: Site URL, 2: User IP address, 3: URL to Network Settings screen. */
        __('New Site: %1$s
URL: %2$s
Remote IP address: %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 (3.0.0)
     * @since 5.4.0 The `$blog_id` parameter was added.
     *
     * @param string $msg     Email body.
     * @param int    $blog_id The new site's ID.
     */
    $msg = apply_filters('newblog_notify_siteadmin', $msg, $blog_id);
    /* translators: New site notification email subject. %s: New site URL. */
    wp_mail($email, sprintf(__('New Site Registration: %s'), $siteurl), $msg);
    return true;
}

WordPress Version: 5.3

/**
 * Notifies the network admin that a new site has been activated.
 *
 * Filter {@see 'newblog_notify_siteadmin'} to change the content of
 * the notification email.
 *
 * @since MU (3.0.0)
 * @since 5.1.0 $blog_id now supports input from the {@see 'wp_initialize_site'} action.
 *
 * @param WP_Site|int $blog_id    The new site's object or ID.
 * @param string      $deprecated Not used.
 * @return bool
 */
function newblog_notify_siteadmin($blog_id, $deprecated = '')
{
    if (is_object($blog_id)) {
        $blog_id = $blog_id->blog_id;
    }
    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();
    $msg = sprintf(
        /* translators: New site notification email. 1: Site URL, 2: User IP address, 3: URL to Network Settings screen. */
        __('New Site: %1$s
URL: %2$s
Remote IP address: %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 (3.0.0)
     *
     * @param string $msg Email body.
     */
    $msg = apply_filters('newblog_notify_siteadmin', $msg);
    /* translators: New site notification email subject. %s: New site URL. */
    wp_mail($email, sprintf(__('New Site Registration: %s'), $siteurl), $msg);
    return true;
}

WordPress Version: 5.1

/**
 * Notifies the network admin that a new site has been activated.
 *
 * Filter {@see 'newblog_notify_siteadmin'} to change the content of
 * the notification email.
 *
 * @since MU (3.0.0)
 * @since 5.1.0 $blog_id now supports input from the {@see 'wp_initialize_site'} action.
 *
 * @param WP_Site|int $blog_id    The new site's object or ID.
 * @param string      $deprecated Not used.
 * @return bool
 */
function newblog_notify_siteadmin($blog_id, $deprecated = '')
{
    if (is_object($blog_id)) {
        $blog_id = $blog_id->blog_id;
    }
    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 address: %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 (3.0.0)
     *
     * @param string $msg Email body.
     */
    $msg = apply_filters('newblog_notify_siteadmin', $msg);
    wp_mail($email, sprintf(__('New Site Registration: %s'), $siteurl), $msg);
    return true;
}

WordPress Version: 4.9

/**
 * Notifies the network admin that a new site has been activated.
 *
 * Filter {@see 'newblog_notify_siteadmin'} to change the content of
 * the notification email.
 *
 * @since MU (3.0.0)
 *
 * @param int    $blog_id    The new site's ID.
 * @param string $deprecated Not used.
 * @return bool
 */
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 address: %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 (3.0.0)
     *
     * @param string $msg Email body.
     */
    $msg = apply_filters('newblog_notify_siteadmin', $msg);
    wp_mail($email, sprintf(__('New Site Registration: %s'), $siteurl), $msg);
    return true;
}

WordPress Version: 4.7

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

WordPress Version: 4.6

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

WordPress Version: 4.5

/**
 * Notifies the network admin that a new site has been activated.
 *
 * Filter 'newblog_notify_siteadmin' to change the content of
 * the notification email.
 *
 * @since MU
 *
 * @param int    $blog_id    The new site's ID.
 * @param string $deprecated Not used.
 * @return bool
 */
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();
    $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);
    /**
     * Filter 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;
}

WordPress Version: 3.8

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

WordPress Version: 3.7

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