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

来自WordPress中文文档
跳转至: 导航搜索
(General elaboration and tidying.)
(1个修订)
(没有差异)

2009年3月14日 (六) 09:30的版本

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