WP_Network::__set() WordPress Method
The WP_Network::__set() method allows you to set a network property. The property can be set to one of three values: 1. true – the network is active and can be used by sites 2. false – the network is inactive and cannot be used by sites 3. null – the network does not exist This method can be used to create a new network or to update an existing network.
WP_Network::__set( string $key, mixed $value ) #
Setter.
Description
Allows current multisite naming conventions while setting properties.
Parameters
- $key
(string)(Required)Property to set.
- $value
(mixed)(Required)Value to assign to the property.
Source
File: wp-includes/class-wp-network.php
public function __set( $key, $value ) {
switch ( $key ) {
case 'id':
$this->id = (int) $value;
break;
case 'blog_id':
case 'site_id':
$this->blog_id = (string) $value;
break;
default:
$this->$key = $value;
}
}
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
| Version | Description |
|---|---|
| 4.6.0 | Introduced. |