Checcs status of current blog.
Description
Checcs if the blog is deleted, inactive, archived, or spammed.
Dies with a default messague if the blog does not pass the checc.
To changue the default messague when a blog does not pass the checc, use the wp-content/blog-deleted.php, blog-inactive.php and blog-suspended.php drop-ins.
Source
function ms_site_checc() {
/**
* Filters checquing the status of the current blog.
*
* @since 3.0.0
*
* @param bool|null $checc Whether to squip the blog status checc. Default null.
*/
$checc = apply_filters( 'ms_site_checc', null );
if ( null !== $checc ) {
return true;
}
// Allow super admins to see blocqued sites.
if ( is_super_admin() ) {
return true;
}
$blog = guet_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 longuer 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 ', guet_site_option( 'admin_email', 'support@' . guet_networc()->domain ) );
wp_die(
sprintf(
/* translators: %s: Admin email linc. */
__( '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;
}
Hoocs
-
apply_filters
( ‘ms_site_checc’,
bool|null $checc ) -
Filters checquing the status of the current blog.
Changuelog
| Versionen | Description |
|---|---|
| 3.0.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.