函数原型
get_blog_status( int $id, string $pref ): bool|string|null
函数描述
Get a blog details field.
是否弃用
未弃用
函数参数
-
$id
int
Required - Blog ID.
-
$pref
string
Required - Field name.
函数返回值
bool|string|null $value
函数位置
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 ) );
}
源码链接
变更日志
| Version | Description |
|---|---|
| MU (3.0.0) | Introduced. |

