WPMU Functions/get current site

来自WordPress中文文档
Carreg讨论2009年3月5日 (四) 15:47的版本 (General elaboration and tidying.)
跳转至: 导航搜索

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; ?%%%