WP_Site::__set
Setter.
Allows current multisite naming conventions while setting properties.
Method of the class: WP_Site{}
No Hooks.
Returns
null. Nothing (null).
Usage
$WP_Site = new WP_Site(); $WP_Site->__set( $key, $value );
- $key(string) (required)
- Property to set.
- $value(mixed) (required)
- Value to assign to the property.
Changelog
| Since 4.6.0 | Introduced. |
WP_Site::__set() WP Site:: set code WP 7.0
public function __set( $key, $value ) {
switch ( $key ) {
case 'id':
$this->blog_id = (string) $value;
break;
case 'network_id':
$this->site_id = (string) $value;
break;
default:
$this->$key = $value;
}
}