On this page
WP_Site::__construct( WP_Site|object $site )
Creates a new WP_Site object.
Description
Will populate object properties from the object provided and assign other default properties based on that information.
Parameters
$siteWP_Site|object Required-
A site object.
Source
File: wp-includes/class-wp-site.php. View all references
public function __construct( $site ) {
foreach ( get_object_vars( $site ) as $key => $value ) {
$this->$key = $value;
}
}
Related
Used By
| Used By | Description |
|---|---|
| wp_maybe_transition_site_statuses_on_update() wp-includes/ms-site.php | Triggers actions on site status updates. |
| get_site() wp-includes/ms-site.php | Retrieves site data given a site ID or site object. |
| WP_Site::get_instance() wp-includes/class-wp-site.php | Retrieves a site from the database by its ID. |
| get_site_by_path() wp-includes/ms-load.php | Retrieves the closest matching site object by its domain and path. |
| clean_blog_cache() wp-includes/ms-site.php | Clean the blog cache |
| get_blog_details() wp-includes/ms-blogs.php | Retrieve the details for a blog from the blogs table and blog options. |
Changelog
| Version | Description |
|---|---|
| 4.5.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_site/__construct