get_current_site

The timeline below displays how wordpress function get_current_site has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.2

/**
 * Gets the current network.
 *
 * Returns an object containing the 'id', 'domain', 'path', and 'site_name'
 * properties of the network being viewed.
 *
 * @see wpmu_current_site()
 *
 * @since MU (3.0.0)
 *
 * @global WP_Network $current_site The current network.
 *
 * @return WP_Network The current network.
 */
function get_current_site()
{
    global $current_site;
    return $current_site;
}

WordPress Version: 6.1

/**
 * Gets the current network.
 *
 * Returns an object containing the 'id', 'domain', 'path', and 'site_name'
 * properties of the network being viewed.
 *
 * @see wpmu_current_site()
 *
 * @since MU (3.0.0)
 *
 * @global WP_Network $current_site
 *
 * @return WP_Network
 */
function get_current_site()
{
    global $current_site;
    return $current_site;
}

WordPress Version: 4.9

/**
 * Get the current network.
 *
 * Returns an object containing the 'id', 'domain', 'path', and 'site_name'
 * properties of the network being viewed.
 *
 * @see wpmu_current_site()
 *
 * @since MU (3.0.0)
 *
 * @global WP_Network $current_site
 *
 * @return WP_Network
 */
function get_current_site()
{
    global $current_site;
    return $current_site;
}

WordPress Version: 4.5

/**
 * Get the current network.
 *
 * Returns an object containing the 'id', 'domain', 'path', and 'site_name'
 * properties of the network being viewed.
 *
 * @see wpmu_current_site()
 *
 * @since MU
 *
 * @global WP_Network $current_site
 *
 * @return WP_Network
 */
function get_current_site()
{
    global $current_site;
    return $current_site;
}

WordPress Version: 4.3

/**
 * 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;
}

WordPress Version: 3.7

/**
 * 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
 *
 * @return object
 */
function get_current_site()
{
    global $current_site;
    return $current_site;
}