update_blog_public

Update this blog's 'public' setting in the global blogs table.

Description

update_blog_public( (int) $old_value, (int) $value ); 

Public blogs have a setting of 1, private blogs are 0.

Parameters (2)

0. $old_value (int)
The old value.
1. $value (int)
The new public value

Usage

  1. if ( !function_exists( 'update_blog_public' ) ) { 
  2. require_once ABSPATH . WPINC . '/ms-functions.php'; 
  3.  
  4. // The old value. 
  5. $old_value = -1; 
  6.  
  7. // The new public value 
  8. $value = -1; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = update_blog_public($old_value, $value); 
  12.  

Defined (1)

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

/wp-includes/ms-functions.php  
  1. function update_blog_public( $old_value, $value ) { 
  2. update_blog_status( get_current_blog_id(), 'public', (int) $value );