W3cubDocs

/WordPress

get_blog_status( int $id, string $pref )

Get a blog details field.

Description

Parameters

$id

(int) (Required) The blog id

$pref

(string) (Required) A field name

Return

(bool|string|null) $value

Source

File: wp-includes/ms-blogs.php

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

Version Description
MU (3.0.0) Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/get_blog_status