WP_Network::__get

Advertisement

Summery Summery

Getter.

Syntax Syntax

WP_Network::__get( string $key )

Description Description

Allows current multisite naming conventions when getting properties.

Parameters Parameters

$key

(Required) Property to get.

Return Return

(mixed) Value of the property. Null if not available.

Source Source

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

	public function __get( $key ) {
		switch ( $key ) {
			case 'id':
				return (int) $this->id;
			case 'blog_id':
				return (string) $this->get_main_site_id();
			case 'site_id':
				return $this->get_main_site_id();
		}

		return null;
	}

Advertisement

Changelog Changelog

Changelog
Version Description
4.6.0 Introduced.

Advertisement

Leave a Reply