WP_Site::__set()publicWP 4.6.0

Setter.

Allows current multisite naming conventions while setting properties.

Method of the class: WP_Site{}

No Hooks.

Return

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() code WP 6.5.2

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;
	}
}