WP_Site::__set() WordPress Method

The WP_Site::__set() method sets a property for a given object.

WP_Site::__set( string $key, mixed $value ) #

Setter.


Description

Allows current multisite naming conventions while setting properties.


Top ↑

Parameters

$key

(string)(Required)Property to set.

$value

(mixed)(Required)Value to assign to the property.


Top ↑

Source

File: wp-includes/class-wp-site.php

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

Top ↑

Changelog

Changelog
VersionDescription
4.6.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.