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

In this article

Gets a blog details field.

Parameters

$idintrequired
Blog ID.
$prefstringrequired
Field name.

Return

bool|string|null $value

Source

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 ) );
}

Changelog

VersionDescription
MU (3.0.0)Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.