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

来自WordPress中文文档
跳转至: 导航搜索
(1个修订)
第1行: 第1行:
 
== Description ==
 
== Description ==
 
+
Returns an object containing various information relating to the site currently being viewed.
Returns an object containing various information relating to the blog currently being viewed.
 
  
 
== Parameters ==
 
== Parameters ==
 
 
None.
 
None.
  
 
== Return Values ==
 
== Return Values ==
 +
; tt(object)/tt : An object containing details of the site currently being viewed. Details are represented in the following public variables:
  
An object containing details of the blog currently being viewed.  Details are represented in the following public variables:
+
:; id : tt(integer)/tt ID of the site currently being viewed.  
; id : ''(integer)'' ID of the blog currently being viewed.
+
:; domain : tt(string)/tt Domain of the site currently being viewed.
; domain : ''(string)'' Domain of the blog currently being viewed.
+
:; path : tt(string)/tt Path of the site currently being viewed.
; path : ''(string)'' Path of the blog currently being viewed.
+
:; site_name : tt(string)/tt Title of the site currently being viewed.
; site_name : ''(string)'' Title of the blog currently being viewed.
 
  
 
== Usage ==
 
== Usage ==
 
 
%%%?php get_current_site(); ?%%%
 
%%%?php get_current_site(); ?%%%
  
 
== Examples ==
 
== Examples ==
 
 
%%%?php
 
%%%?php
 
$current_site = get_current_site();
 
$current_site = get_current_site();
第32行: 第28行:
  
 
[[Category:WPMU]]
 
[[Category:WPMU]]
 +
[[Category:WPMU Functions]]

2009年10月17日 (六) 14:36的版本

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