get_current_site()获取当前站点信息(多站点)

目录

描述

Gets the current site based on the value of the $current_site global variable.

get_current_site() 描述

用法

<?php get_current_site(); ?>

get_current_site() 用法

参数

None

get_current_site() 参数

返回值

(Object) 

Returns current site object.

get_current_site() 返回值

源文件

get_current_site() 函数的代码位于 wp-includes/ms-functions.php.

/* ----------------------------------
 * wordpress之魂 © http://wphun.com
 * ---------------------------------- */
/**
 * Get the current site info.
 *
 * Returns an object containing the 'id', 'domain', 'path', and 'site_name'
 * properties of the site being viewed.
 *
 * @see wpmu_current_site()
 *
 * @since MU
 *
 * @global object $current_site
 *
 * @return object
 */
function get_current_site() {
	global $current_site;
	return $current_site;
}

get_current_site() 源文件