ms_site_check

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

WordPress Version: 5.4

/**
 * Checks status of current blog.
 *
 * Checks if the blog is deleted, inactive, archived, or spammed.
 *
 * Dies with a default message if the blog does not pass the check.
 *
 * To change the default message when a blog does not pass the check,
 * use the wp-content/blog-deleted.php, blog-inactive.php and
 * blog-suspended.php drop-ins.
 *
 * @since 3.0.0
 *
 * @return true|string Returns true on success, or drop-in file to include.
 */
function ms_site_check()
{
    /**
     * Filters checking the status of the current blog.
     *
     * @since 3.0.0
     *
     * @param bool|null $check Whether to skip the blog status check. Default null.
     */
    $check = apply_filters('ms_site_check', null);
    if (null !== $check) {
        return true;
    }
    // Allow super admins to see blocked sites.
    if (is_super_admin()) {
        return true;
    }
    $blog = get_site();
    if ('1' == $blog->deleted) {
        if (file_exists(WP_CONTENT_DIR . '/blog-deleted.php')) {
            return WP_CONTENT_DIR . '/blog-deleted.php';
        } else {
            wp_die(__('This site is no longer available.'), '', array('response' => 410));
        }
    }
    if ('2' == $blog->deleted) {
        if (file_exists(WP_CONTENT_DIR . '/blog-inactive.php')) {
            return WP_CONTENT_DIR . '/blog-inactive.php';
        } else {
            $admin_email = str_replace('@', ' AT ', get_site_option('admin_email', 'support@' . get_network()->domain));
            wp_die(sprintf(
                /* translators: %s: Admin email link. */
                __('This site has not been activated yet. If you are having problems activating your site, please contact %s.'),
                sprintf('<a href="mailto:%1$s">%1$s</a>', $admin_email)
            ));
        }
    }
    if ('1' == $blog->archived || '1' == $blog->spam) {
        if (file_exists(WP_CONTENT_DIR . '/blog-suspended.php')) {
            return WP_CONTENT_DIR . '/blog-suspended.php';
        } else {
            wp_die(__('This site has been archived or suspended.'), '', array('response' => 410));
        }
    }
    return true;
}

WordPress Version: 5.3

/**
 * Checks status of current blog.
 *
 * Checks if the blog is deleted, inactive, archived, or spammed.
 *
 * Dies with a default message if the blog does not pass the check.
 *
 * To change the default message when a blog does not pass the check,
 * use the wp-content/blog-deleted.php, blog-inactive.php and
 * blog-suspended.php drop-ins.
 *
 * @since 3.0.0
 *
 * @return true|string Returns true on success, or drop-in file to include.
 */
function ms_site_check()
{
    /**
     * Filters checking the status of the current blog.
     *
     * @since 3.0.0
     *
     * @param bool null Whether to skip the blog status check. Default null.
     */
    $check = apply_filters('ms_site_check', null);
    if (null !== $check) {
        return true;
    }
    // Allow super admins to see blocked sites
    if (is_super_admin()) {
        return true;
    }
    $blog = get_site();
    if ('1' == $blog->deleted) {
        if (file_exists(WP_CONTENT_DIR . '/blog-deleted.php')) {
            return WP_CONTENT_DIR . '/blog-deleted.php';
        } else {
            wp_die(__('This site is no longer available.'), '', array('response' => 410));
        }
    }
    if ('2' == $blog->deleted) {
        if (file_exists(WP_CONTENT_DIR . '/blog-inactive.php')) {
            return WP_CONTENT_DIR . '/blog-inactive.php';
        } else {
            $admin_email = str_replace('@', ' AT ', get_site_option('admin_email', 'support@' . get_network()->domain));
            wp_die(sprintf(
                /* translators: %s: Admin email link. */
                __('This site has not been activated yet. If you are having problems activating your site, please contact %s.'),
                sprintf('<a href="mailto:%1$s">%1$s</a>', $admin_email)
            ));
        }
    }
    if ($blog->archived == '1' || $blog->spam == '1') {
        if (file_exists(WP_CONTENT_DIR . '/blog-suspended.php')) {
            return WP_CONTENT_DIR . '/blog-suspended.php';
        } else {
            wp_die(__('This site has been archived or suspended.'), '', array('response' => 410));
        }
    }
    return true;
}

WordPress Version: 5.2

/**
 * Checks status of current blog.
 *
 * Checks if the blog is deleted, inactive, archived, or spammed.
 *
 * Dies with a default message if the blog does not pass the check.
 *
 * To change the default message when a blog does not pass the check,
 * use the wp-content/blog-deleted.php, blog-inactive.php and
 * blog-suspended.php drop-ins.
 *
 * @since 3.0.0
 *
 * @return true|string Returns true on success, or drop-in file to include.
 */
function ms_site_check()
{
    /**
     * Filters checking the status of the current blog.
     *
     * @since 3.0.0
     *
     * @param bool null Whether to skip the blog status check. Default null.
     */
    $check = apply_filters('ms_site_check', null);
    if (null !== $check) {
        return true;
    }
    // Allow super admins to see blocked sites
    if (is_super_admin()) {
        return true;
    }
    $blog = get_site();
    if ('1' == $blog->deleted) {
        if (file_exists(WP_CONTENT_DIR . '/blog-deleted.php')) {
            return WP_CONTENT_DIR . '/blog-deleted.php';
        } else {
            wp_die(__('This site is no longer available.'), '', array('response' => 410));
        }
    }
    if ('2' == $blog->deleted) {
        if (file_exists(WP_CONTENT_DIR . '/blog-inactive.php')) {
            return WP_CONTENT_DIR . '/blog-inactive.php';
        } else {
            $admin_email = str_replace('@', ' AT ', get_site_option('admin_email', 'support@' . get_network()->domain));
            wp_die(
                /* translators: %s: admin email link */
                sprintf(__('This site has not been activated yet. If you are having problems activating your site, please contact %s.'), sprintf('<a href="mailto:%1$s">%1$s</a>', $admin_email))
            );
        }
    }
    if ($blog->archived == '1' || $blog->spam == '1') {
        if (file_exists(WP_CONTENT_DIR . '/blog-suspended.php')) {
            return WP_CONTENT_DIR . '/blog-suspended.php';
        } else {
            wp_die(__('This site has been archived or suspended.'), '', array('response' => 410));
        }
    }
    return true;
}

WordPress Version: 4.7

/**
 * Checks status of current blog.
 *
 * Checks if the blog is deleted, inactive, archived, or spammed.
 *
 * Dies with a default message if the blog does not pass the check.
 *
 * To change the default message when a blog does not pass the check,
 * use the wp-content/blog-deleted.php, blog-inactive.php and
 * blog-suspended.php drop-ins.
 *
 * @since 3.0.0
 *
 * @return true|string Returns true on success, or drop-in file to include.
 */
function ms_site_check()
{
    /**
     * Filters checking the status of the current blog.
     *
     * @since 3.0.0
     *
     * @param bool null Whether to skip the blog status check. Default null.
     */
    $check = apply_filters('ms_site_check', null);
    if (null !== $check) {
        return true;
    }
    // Allow super admins to see blocked sites
    if (is_super_admin()) {
        return true;
    }
    $blog = get_site();
    if ('1' == $blog->deleted) {
        if (file_exists(WP_CONTENT_DIR . '/blog-deleted.php')) {
            return WP_CONTENT_DIR . '/blog-deleted.php';
        } else {
            wp_die(__('This site is no longer available.'), '', array('response' => 410));
        }
    }
    if ('2' == $blog->deleted) {
        if (file_exists(WP_CONTENT_DIR . '/blog-inactive.php')) {
            return WP_CONTENT_DIR . '/blog-inactive.php';
        } else {
            $admin_email = str_replace('@', ' AT ', get_site_option('admin_email', 'support@' . get_network()->domain));
            wp_die(
                /* translators: %s: admin email link */
                sprintf(__('This site has not been activated yet. If you are having problems activating your site, please contact %s.'), sprintf('<a href="mailto:%s">%s</a>', $admin_email))
            );
        }
    }
    if ($blog->archived == '1' || $blog->spam == '1') {
        if (file_exists(WP_CONTENT_DIR . '/blog-suspended.php')) {
            return WP_CONTENT_DIR . '/blog-suspended.php';
        } else {
            wp_die(__('This site has been archived or suspended.'), '', array('response' => 410));
        }
    }
    return true;
}

WordPress Version: 4.6

/**
 * Checks status of current blog.
 *
 * Checks if the blog is deleted, inactive, archived, or spammed.
 *
 * Dies with a default message if the blog does not pass the check.
 *
 * To change the default message when a blog does not pass the check,
 * use the wp-content/blog-deleted.php, blog-inactive.php and
 * blog-suspended.php drop-ins.
 *
 * @since 3.0.0
 *
 * @return true|string Returns true on success, or drop-in file to include.
 */
function ms_site_check()
{
    /**
     * Filters checking the status of the current blog.
     *
     * @since 3.0.0
     *
     * @param bool null Whether to skip the blog status check. Default null.
     */
    $check = apply_filters('ms_site_check', null);
    if (null !== $check) {
        return true;
    }
    // Allow super admins to see blocked sites
    if (is_super_admin()) {
        return true;
    }
    $blog = get_blog_details();
    if ('1' == $blog->deleted) {
        if (file_exists(WP_CONTENT_DIR . '/blog-deleted.php')) {
            return WP_CONTENT_DIR . '/blog-deleted.php';
        } else {
            wp_die(__('This site is no longer available.'), '', array('response' => 410));
        }
    }
    if ('2' == $blog->deleted) {
        if (file_exists(WP_CONTENT_DIR . '/blog-inactive.php')) {
            return WP_CONTENT_DIR . '/blog-inactive.php';
        } else {
            $admin_email = str_replace('@', ' AT ', get_site_option('admin_email', 'support@' . get_current_site()->domain));
            wp_die(
                /* translators: %s: admin email link */
                sprintf(__('This site has not been activated yet. If you are having problems activating your site, please contact %s.'), sprintf('<a href="mailto:%s">%s</a>', $admin_email))
            );
        }
    }
    if ($blog->archived == '1' || $blog->spam == '1') {
        if (file_exists(WP_CONTENT_DIR . '/blog-suspended.php')) {
            return WP_CONTENT_DIR . '/blog-suspended.php';
        } else {
            wp_die(__('This site has been archived or suspended.'), '', array('response' => 410));
        }
    }
    return true;
}

WordPress Version: 4.4

/**
 * Checks status of current blog.
 *
 * Checks if the blog is deleted, inactive, archived, or spammed.
 *
 * Dies with a default message if the blog does not pass the check.
 *
 * To change the default message when a blog does not pass the check,
 * use the wp-content/blog-deleted.php, blog-inactive.php and
 * blog-suspended.php drop-ins.
 *
 * @since 3.0.0
 *
 * @return true|string Returns true on success, or drop-in file to include.
 */
function ms_site_check()
{
    $blog = get_blog_details();
    /**
     * Filter checking the status of the current blog.
     *
     * @since 3.0.0
     *
     * @param bool null Whether to skip the blog status check. Default null.
     */
    $check = apply_filters('ms_site_check', null);
    if (null !== $check) {
        return true;
    }
    // Allow super admins to see blocked sites
    if (is_super_admin()) {
        return true;
    }
    if ('1' == $blog->deleted) {
        if (file_exists(WP_CONTENT_DIR . '/blog-deleted.php')) {
            return WP_CONTENT_DIR . '/blog-deleted.php';
        } else {
            wp_die(__('This site is no longer available.'), '', array('response' => 410));
        }
    }
    if ('2' == $blog->deleted) {
        if (file_exists(WP_CONTENT_DIR . '/blog-inactive.php')) {
            return WP_CONTENT_DIR . '/blog-inactive.php';
        } else {
            $admin_email = str_replace('@', ' AT ', get_site_option('admin_email', 'support@' . get_current_site()->domain));
            wp_die(
                /* translators: %s: admin email link */
                sprintf(__('This site has not been activated yet. If you are having problems activating your site, please contact %s.'), sprintf('<a href="mailto:%s">%s</a>', $admin_email))
            );
        }
    }
    if ($blog->archived == '1' || $blog->spam == '1') {
        if (file_exists(WP_CONTENT_DIR . '/blog-suspended.php')) {
            return WP_CONTENT_DIR . '/blog-suspended.php';
        } else {
            wp_die(__('This site has been archived or suspended.'), '', array('response' => 410));
        }
    }
    return true;
}

WordPress Version: 4.3

/**
 * Checks status of current blog.
 *
 * Checks if the blog is deleted, inactive, archived, or spammed.
 *
 * Dies with a default message if the blog does not pass the check.
 *
 * To change the default message when a blog does not pass the check,
 * use the wp-content/blog-deleted.php, blog-inactive.php and
 * blog-suspended.php drop-ins.
 *
 * @since 3.0.0
 *
 * @return true|string Returns true on success, or drop-in file to include.
 */
function ms_site_check()
{
    $blog = get_blog_details();
    /**
     * Filter checking the status of the current blog.
     *
     * @since 3.0.0
     *
     * @param bool null Whether to skip the blog status check. Default null.
     */
    $check = apply_filters('ms_site_check', null);
    if (null !== $check) {
        return true;
    }
    // Allow super admins to see blocked sites
    if (is_super_admin()) {
        return true;
    }
    if ('1' == $blog->deleted) {
        if (file_exists(WP_CONTENT_DIR . '/blog-deleted.php')) {
            return WP_CONTENT_DIR . '/blog-deleted.php';
        } else {
            wp_die(__('This site is no longer available.'), '', array('response' => 410));
        }
    }
    if ('2' == $blog->deleted) {
        if (file_exists(WP_CONTENT_DIR . '/blog-inactive.php')) {
            return WP_CONTENT_DIR . '/blog-inactive.php';
        } else {
            wp_die(sprintf(__('This site has not been activated yet. If you are having problems activating your site, please contact <a href="mailto:%1$s">%1$s</a>.'), str_replace('@', ' AT ', get_site_option('admin_email', 'support@' . get_current_site()->domain))));
        }
    }
    if ($blog->archived == '1' || $blog->spam == '1') {
        if (file_exists(WP_CONTENT_DIR . '/blog-suspended.php')) {
            return WP_CONTENT_DIR . '/blog-suspended.php';
        } else {
            wp_die(__('This site has been archived or suspended.'), '', array('response' => 410));
        }
    }
    return true;
}

WordPress Version: 4.0

/**
 * Checks status of current blog.
 *
 * Checks if the blog is deleted, inactive, archived, or spammed.
 *
 * Dies with a default message if the blog does not pass the check.
 *
 * To change the default message when a blog does not pass the check,
 * use the wp-content/blog-deleted.php, blog-inactive.php and
 * blog-suspended.php drop-ins.
 *
 * @since 3.0.0
 *
 * @return bool|string Returns true on success, or drop-in file to include.
 */
function ms_site_check()
{
    $blog = get_blog_details();
    /**
     * Filter checking the status of the current blog.
     *
     * @since 3.0.0
     *
     * @param bool null Whether to skip the blog status check. Default null.
     */
    $check = apply_filters('ms_site_check', null);
    if (null !== $check) {
        return true;
    }
    // Allow super admins to see blocked sites
    if (is_super_admin()) {
        return true;
    }
    if ('1' == $blog->deleted) {
        if (file_exists(WP_CONTENT_DIR . '/blog-deleted.php')) {
            return WP_CONTENT_DIR . '/blog-deleted.php';
        } else {
            wp_die(__('This site is no longer available.'), '', array('response' => 410));
        }
    }
    if ('2' == $blog->deleted) {
        if (file_exists(WP_CONTENT_DIR . '/blog-inactive.php')) {
            return WP_CONTENT_DIR . '/blog-inactive.php';
        } else {
            wp_die(sprintf(__('This site has not been activated yet. If you are having problems activating your site, please contact <a href="mailto:%1$s">%1$s</a>.'), str_replace('@', ' AT ', get_site_option('admin_email', 'support@' . get_current_site()->domain))));
        }
    }
    if ($blog->archived == '1' || $blog->spam == '1') {
        if (file_exists(WP_CONTENT_DIR . '/blog-suspended.php')) {
            return WP_CONTENT_DIR . '/blog-suspended.php';
        } else {
            wp_die(__('This site has been archived or suspended.'), '', array('response' => 410));
        }
    }
    return true;
}

WordPress Version: 3.8

/**
 * Checks status of current blog.
 *
 * Checks if the blog is deleted, inactive, archived, or spammed.
 *
 * Dies with a default message if the blog does not pass the check.
 *
 * To change the default message when a blog does not pass the check,
 * use the wp-content/blog-deleted.php, blog-inactive.php and
 * blog-suspended.php drop-ins.
 *
 * @since 3.0.0
 *
 * @return bool|string Returns true on success, or drop-in file to include.
 */
function ms_site_check()
{
    $blog = get_blog_details();
    /**
     * Filter checking the status of the current blog.
     *
     * @since 3.0.0
     *
     * @param bool null Whether to skip the blog status check. Default null.
     */
    $check = apply_filters('ms_site_check', null);
    if (null !== $check) {
        return true;
    }
    // Allow super admins to see blocked sites
    if (is_super_admin()) {
        return true;
    }
    if ('1' == $blog->deleted) {
        if (file_exists(WP_CONTENT_DIR . '/blog-deleted.php')) {
            return WP_CONTENT_DIR . '/blog-deleted.php';
        } else {
            wp_die(__('This user has elected to delete their account and the content is no longer available.'), '', array('response' => 410));
        }
    }
    if ('2' == $blog->deleted) {
        if (file_exists(WP_CONTENT_DIR . '/blog-inactive.php')) {
            return WP_CONTENT_DIR . '/blog-inactive.php';
        } else {
            wp_die(sprintf(__('This site has not been activated yet. If you are having problems activating your site, please contact <a href="mailto:%1$s">%1$s</a>.'), str_replace('@', ' AT ', get_site_option('admin_email', 'support@' . get_current_site()->domain))));
        }
    }
    if ($blog->archived == '1' || $blog->spam == '1') {
        if (file_exists(WP_CONTENT_DIR . '/blog-suspended.php')) {
            return WP_CONTENT_DIR . '/blog-suspended.php';
        } else {
            wp_die(__('This site has been archived or suspended.'), '', array('response' => 410));
        }
    }
    return true;
}

WordPress Version: 3.7

/**
 * Checks status of current blog.
 *
 * Checks if the blog is deleted, inactive, archived, or spammed.
 *
 * Dies with a default message if the blog does not pass the check.
 *
 * To change the default message when a blog does not pass the check,
 * use the wp-content/blog-deleted.php, blog-inactive.php and
 * blog-suspended.php drop-ins.
 *
 * @return bool|string Returns true on success, or drop-in file to include.
 */
function ms_site_check()
{
    global $wpdb, $current_site;
    $blog = get_blog_details();
    /**
     * Filter checking the status of the current blog.
     *
     * @since 1.2.1
     *
     * @param bool null Whether to skip the blog status check. Default null.
     */
    $check = apply_filters('ms_site_check', null);
    if (null !== $check) {
        return true;
    }
    // Allow super admins to see blocked sites
    if (is_super_admin()) {
        return true;
    }
    if ('1' == $blog->deleted) {
        if (file_exists(WP_CONTENT_DIR . '/blog-deleted.php')) {
            return WP_CONTENT_DIR . '/blog-deleted.php';
        } else {
            wp_die(__('This user has elected to delete their account and the content is no longer available.'), '', array('response' => 410));
        }
    }
    if ('2' == $blog->deleted) {
        if (file_exists(WP_CONTENT_DIR . '/blog-inactive.php')) {
            return WP_CONTENT_DIR . '/blog-inactive.php';
        } else {
            wp_die(sprintf(__('This site has not been activated yet. If you are having problems activating your site, please contact <a href="mailto:%1$s">%1$s</a>.'), str_replace('@', ' AT ', get_site_option('admin_email', "support@{$current_site->domain}"))));
        }
    }
    if ($blog->archived == '1' || $blog->spam == '1') {
        if (file_exists(WP_CONTENT_DIR . '/blog-suspended.php')) {
            return WP_CONTENT_DIR . '/blog-suspended.php';
        } else {
            wp_die(__('This site has been archived or suspended.'), '', array('response' => 410));
        }
    }
    return true;
}