get_blog_status()

获取博客状态(多站点)

描述

Get a blog details field.

用法

<?php get_blog_status( $id, $pref ) ?>

参数

$id

(integer) (必填) The blog id

默认值: None

$pref

(string) (必填) A field name

默认值: None

返回值

(mixed

The value from the field

示例

//暂无

加于 版本: 3.0.0

源文件

get_blog_status() 函数的代码位于 wp-includes/ms-blogs.php

/* ———————————-
* wordpress函数
* ———————————- */
/**
* Get a blog details field.
*
* @since MU
*
* @global wpdb $wpdb
*
* @param int    $id   The blog id
* @param string $pref A field name
* @return bool|string|null $value
*/

function get_blog_status( $id, $pref ) {

global $wpdb;

$details = get_blog_details( $id, false );

if ( $details )

return $details->$pref;

return $wpdb->get_var( $wpdb->prepare(“SELECT %s FROM {$wpdb->blogs} WHERE blog_id = %d”, $pref, $id) );

}

相关

  • 原文:http://codex.wordpress.org/Function_Reference/get_blog_status
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索