WordPress at Your Fingertips
function is not described

WP_Site::__construct() public WP 4.5.0

Creates a new WP_Site object.

Will populate object properties from the object provided and assign other default properties based on that information.

{} It's a method of the class: WP_Site{}

No Hooks.


null. Nothing.


$WP_Site = new WP_Site();
$WP_Site->__construct( $site );
$site(WP_Site|object) (required)
A site object.


Since 4.5.0 Introduced.

Code of WP_Site::__construct() WP 5.9

public function __construct( $site ) {
	foreach ( get_object_vars( $site ) as $key => $value ) {
		$this->$key = $value;