Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




ms_site_check [ WordPress Function ]

ms_site_check ( No parameters )
Returns:
  • (bool|string) Returns true on success, or drop-in file to include.
Defined at:



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.

Source


<?php
function ms_site_check() {
    global 
$wpdb$current_blog;

    
// Allow short-circuiting
    
$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' == $current_blog->deleted ) {
        if ( 
file_existsWP_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' == $current_blog->deleted ) {
        if ( 
file_existsWP_CONTENT_DIR '/blog-inactive.php' ) )
            return 
WP_CONTENT_DIR '/blog-inactive.php';
        else
            
wp_diesprintf__'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 ( 
$current_blog->archived == '1' || $current_blog->spam == '1' ) {
        if ( 
file_existsWP_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;
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics