WordPress开发者和主题制作者的搜索引擎



get_blog_status ›

Since3.0.0
已弃用n/a
get_blog_status ( $id, $pref )
参数: (2)
  • (int) $id Blog ID.
    Required: Yes
  • (string) $pref Field name.
    Required: Yes
返回:
  • (bool|string|null) $value
定义在:
文档:
Change Log:
  • MU

Get a blog details field.



源码

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