bp_is_blog_public

Filters whether or not the current blog is public.

Description

apply_filters( 'bp_is_blog_public', (int) $int_get_option_blog_public ); 

In case the config is not multisite, the blog_public option is ignored.

Parameters (1)

0. $int_get_option_blog_public (int) => (int) get_option( 'blog_public' )
Whether or not the blog is public.

Usage

To run the hook, copy the example below.
  1. $int_get_option_blog_public = apply_filters( 'bp_is_blog_public', $int_get_option_blog_public ); 
  2.  
  3. if ( !empty( $int_get_option_blog_public ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the bp_is_blog_public callback 
  2. function filter_bp_is_blog_public( $int_get_option_blog_public ) { 
  3. // make filter magic happen here... 
  4. return $int_get_option_blog_public
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'bp_is_blog_public', 'filter_bp_is_blog_public', 10, 1 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'bp_is_blog_public', 'filter_bp_is_blog_public', 10, 1 ); 

Defined (2)

The filter is defined in the following location(s).

/bp-blogs/classes/class-bp-blogs-component.php  
  1. if ( 0 !== apply_filters( 'bp_is_blog_public', (int) get_option( 'blog_public' ) ) || ! is_multisite() ) { 
/bp-blogs/bp-blogs-filters.php  
  1. $is_blog_public = apply_filters( 'bp_is_blog_public', (int) get_blog_option( $blog_id, 'blog_public' ) );