WPMU Functions/get current site
Returns an object containing various information relating to the current network.
Note: get_current_site() was inherited from MU, and is named based on the old terminology which spoke of multiple "blogs" on a "site". We now speak of multiple "sites" on a "network" instead, but some of the old terminology still lives on in some function names. This function returns information about the current network. To get information about the current site on the network, see get_current_blog_id() and get_blog_details().
%%%<?php get_current_site(); ?>%%%
- An object containing details of the site currently being viewed. Details are represented in the following public variables:
- (integer) ID of the site currently being viewed.
- (string) Domain of the site currently being viewed.
- (string) Path of the site currently being viewed.
- (string) Title of the site currently being viewed.
<?php $current_site = get_current_site(); echo 'You are viewing ' . $current_site->site_name; ?>
get_current_site() is located in onlyincludecodewp-includes/ms-functions.php/code/onlyinclude
div class=template-description style=padding: 0 1.5em; border: 1px solid #eeeeee; background-color: #f9f9f9
Link to the source code on http://core.trac.wordpress.org/browser/.
- (option) path to codetag/code (version) or codetrunk/code. This option is only used for a new function.br /Default: codetrunk/code -- trunk is the latest bleeding edge development version of WordPress.
Link to the stable version: pre检查到模板循环：模板:Trac/pre
Link to trunk: pre检查到模板循环：模板:Trac/pre
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
This Template is used by Codex:Template Messages.
pre 检查到模板循环：模板:Message /pre