get_blog_status

Get a blog details field.

Description

(bool|string|null) get_blog_status( (int) $id, (string) $pref ); 

Returns (bool|string|null)

$value

Parameters (2)

0. $id (int)
The blog id
1. $pref (string)
A field name

Usage

  1. if ( !function_exists( 'get_blog_status' ) ) { 
  2. require_once ABSPATH . WPINC . '/ms-blogs.php'; 
  3.  
  4. // The blog id 
  5. $id = -1; 
  6.  
  7. // A field name 
  8. $pref = ''; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = get_blog_status($id, $pref); 
  12.  

Defined (1)

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

/wp-includes/ms-blogs.php  
  1. function get_blog_status( $id, $pref ) { 
  2. global $wpdb; 
  3.  
  4. $details = get_site( $id ); 
  5. if ( $details ) 
  6. return $details->$pref; 
  7.  
  8. return $wpdb->get_var( $wpdb->prepare("SELECT %s FROM {$wpdb->blogs} WHERE blog_id = %d", $pref, $id) );