get_site

SummerySummery

Retrieves site data given a site ID or site object.

Syntax

get_site( WP_Site|int|null $site = null )

DescriptionDescription

Site data will be cached and returned after being passed through a filter. If the provided site is empty, the current site global will be used.

ParametersParameters

$site

(WP_Site|int|null) (Optional) Site to retrieve. Default is the current site.

Default value: null

ReturnReturn

(WP_Site|null) The site object or null if not found.

SourceSource

File: wp-includes/ms-site.php


			

ChangelogChangelog

Changelog
Version Description
4.6.0 Introduced.
Scroll to Top