BP_Blogs_Blog::is_hidden( int $blog_id )

Check whether a given blog is hidden.

Description

Checks the ‘public’ column in the wp_blogs table.

Parameters

$blog_id

(Required) The ID of the blog being checked.

Return

(bool) True if hidden (public = 0), false otherwise.

Source

File: bp-blogs/classes/class-bp-blogs-blog.php

672
673
674
675
676
677
678
679
680
public static function is_hidden( $blog_id ) {
    global $wpdb;
 
    if ( !(int) $wpdb->get_var( $wpdb->prepare( "SELECT public FROM {$wpdb->base_prefix}blogs WHERE blog_id = %d", $blog_id ) ) ) {
        return true;
    }
 
    return false;
}

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.