Creates a new WP_Site object.
Will populate object properties from the object provided and assign other default properties based on that information.
$siteWP_Site|objectrequired
public function __construct( $site ) {
foreach ( get_object_vars( $site ) as $key => $value ) {
$this->$key = $value;
}
}
| Version | Description |
|---|---|
| 4.5.0 | Introduced. |
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_site/__construct