WPMU Functions/get current site

来自WordPress中文文档
Zhuozuran讨论 | 贡献2009年3月14日 (六) 09:30的版本 (1个修订)
跳转至: 导航搜索

Description

Returns an object containing various information relating to the blog currently being viewed.

Parameters

None.

Return Values

An object containing details of the blog currently being viewed. Details are represented in the following public variables:

id 
(integer) ID of the blog currently being viewed.
domain 
(string) Domain of the blog currently being viewed.
path 
(string) Path of the blog currently being viewed.
site_name 
(string) Title of the blog currently being viewed.

Usage

%%%?php get_current_site(); ?%%%

Examples

%%%?php $current_site = get_current_site(); echo 'You are viewing '.$current_site-site_name; ?%%% %%%?php echo 'You are viewing '.get_current_site()-site_name; ?%%%