bbp_is_site_public

Check if current site is public.

Description

bbp_is_site_public( (int) $site_id = 0 ); 

Parameters (1)

0. $site_id — Optional. (int)
The site id.

Usage

  1. if ( !function_exists( 'bbp_is_site_public' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bbpress/includes/common/template.php'; 
  3.  
  4. // The site id. 
  5. $site_id = -1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bbp_is_site_public($site_id); 
  9.  

Defined (1)

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

/includes/common/template.php  
  1. function bbp_is_site_public( $site_id = 0 ) { 
  2.  
  3. // Get the current site ID 
  4. if ( empty( $site_id ) ) 
  5. $site_id = get_current_blog_id(); 
  6.  
  7. // Get the site visibility setting 
  8. $public = get_blog_option( $site_id, 'blog_public', 1 ); 
  9.  
  10. return (bool) apply_filters( 'bbp_is_site_public', $public, $site_id );