WP_Network::__construct( WP_Network|object $network )
- Since
- 4.4.0
- Source
wp-includes/class-wp-network.php:132
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- A network object.
Uses · 3
- WP_Network::__set()Setter.
- WP_Network::_set_site_name()Sets the site name assigned to the network if one has not been populated.
- WP_Network::_set_cookie_domain()Sets the cookie domain based on the network domain if one has not been populated.
Used by · 2
- WP_Network::get_instance()Retrieves a network from the database by its ID.
- get_network()Retrieves network data given a network ID or network object.
Source
public function __construct( $network ) { foreach ( get_object_vars( $network ) as $key => $value ) { $this->__set( $key, $value ); } $this->_set_site_name(); $this->_set_cookie_domain(); }History
Introduced in 4.4.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 6.8.8 tag, from
src/wp-includes/class-wp-network.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.