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

来自WordPress中文文档
跳转至: 导航搜索
(Changing formating, marking as stub)
(1个版本)
(没有差异)

2013年8月2日 (五) 04:23的版本

Description

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

Usage

%%%<?php get_current_site(); ?>%%%

Parameters

None.

Return Values

(object) 
An object containing details of the site currently being viewed. Details are represented in the following public variables:
id 
(integer) ID of the site currently being viewed.
domain 
(string) Domain of the site currently being viewed.
path 
(string) Path of the site currently being viewed.
site_name 
(string) Title of the site currently being viewed.

Examples

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

includeonlydiv style=clear:both; background-color:#FAEBD7; border:1px solid #CCCCCC; color:#000000; padding:7px; margin:0.5em auto 0.5em auto; vertical-align:middle;This page is marked as incomplete. You can help Codex by expanding it./div/includeonlynoinclude

Description

This Template is used by Codex:Template Messages.

Usage

pre 检查到模板循环:模板:Message /pre

Result

检查到模板循环:模板:Message

/noinclude