get_blog_status()WP 3.0.0

Gets a blog details field.

No Hooks.

Return

true|false|String|null. $value

Usage

get_blog_status( $id, $pref );
$id(int) (required)
Blog ID.
$pref(string) (required)
Field name.

Notes

  • Global. wpdb. $wpdb WordPress database abstraction object.

Changelog

Since 3.0.0 Introduced.

get_blog_status() code WP 6.6.2

function get_blog_status( $id, $pref ) {
	global $wpdb;

	$details = get_site( $id );
	if ( $details ) {
		return $details->$pref;
	}

	return $wpdb->get_var( $wpdb->prepare( "SELECT %s FROM {$wpdb->blogs} WHERE blog_id = %d", $pref, $id ) );
}