get_blog_status

函数


get_blog_status ( $id, $pref )
参数
  • (int)
    $id
    Blog ID.
    Required:
  • (string)
    $pref
    Field name.
    Required:
返回值
  • (bool|string|null) $value
定义位置
  • wp-includes/ms-blogs.php
    , line 794
引入
弃用

获得一个博客的细节字段。

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