WordPress.org

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

WPMU Functions/get current site

Description

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().

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

Source File

get_current_site() is located in wp-includes/ms-functions.php.



This page is marked as incomplete. You can help Codex by expanding it.