WP_Site::__construct()publicWP 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.

Method of the class: WP_Site{}

No Hooks.

Return

null. Nothing (null).

Usage

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

Changelog

Since 4.5.0 Introduced.

WP_Site::__construct() code WP 6.4.3

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