WP_Site::__isset

Advertisement

Summery Summery

Isset-er.

Syntax Syntax

WP_Site::__isset( string $key )

Description Description

Allows current multisite naming conventions when checking for properties. Checks for extended site properties.

Parameters Parameters

$key

(string) (Required) Property to check if set.

Return Return

(bool) Whether the property is set.

Source Source

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

	public function __isset( $key ) {
		switch ( $key ) {
			case 'id':
			case 'network_id':
				return true;
			case 'blogname':
			case 'siteurl':
			case 'post_count':
			case 'home':
				if ( ! did_action( 'ms_loaded' ) ) {
					return false;
				}
				return true;
			default: // Custom properties added by 'site_details' filter.
				if ( ! did_action( 'ms_loaded' ) ) {
					return false;
				}

				$details = $this->get_details();
				if ( isset( $details->$key ) ) {
					return true;
				}
		}

		return false;
	}

Advertisement

Changelog Changelog

Changelog
Version Description
4.6.0 Introduced.

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.