“WPMU Functions/get current site”的版本间的差异

来自WordPress中文文档
跳转至: 导航搜索
Bot讨论 | 贡献
(1个修订)
(没有差异)

2010年7月23日 (五) 11:08的版本

Description

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

Parameters

None.

Return Values

tt(object)/tt 
An object containing details of the site currently being viewed. Details are represented in the following public variables:
id 
tt(integer)/tt ID of the site currently being viewed.
domain 
tt(string)/tt Domain of the site currently being viewed.
path 
tt(string)/tt Path of the site currently being viewed.
site_name 
tt(string)/tt Title of the site 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; ?%%%