On this page
WP_Network::__construct( WP_Network|object $network )
Creates a new WP_Network object.
Description
Will populate object properties from the object provided and assign other default properties based on that information.
Parameters
$networkWP_Network|object Required-
A network object.
Source
File: wp-includes/class-wp-network.php. View all references
public function __construct( $network ) {
foreach ( get_object_vars( $network ) as $key => $value ) {
$this->$key = $value;
}
$this->_set_site_name();
$this->_set_cookie_domain();
}
Related
Uses
| Uses | Description |
|---|---|
| WP_Network::_set_site_name() wp-includes/class-wp-network.php | Sets the site name assigned to the network if one has not been populated. |
| WP_Network::_set_cookie_domain() wp-includes/class-wp-network.php | Sets the cookie domain based on the network domain if one has not been populated. |
Used By
| Used By | Description |
|---|---|
| get_network() wp-includes/ms-network.php | Retrieves network data given a network ID or network object. |
| WP_Network::get_instance() wp-includes/class-wp-network.php | Retrieves a network from the database by its ID. |
Changelog
| Version | Description |
|---|---|
| 4.4.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_network/__construct