WP_Customize_Setting::multidimensional_get() WordPress Method

This method is used to get a multidimensional value from a WP_Customize_Setting object. The first parameter is the key of the multidimensional array. The second parameter is the index of the array. This method returns the value of the multidimensional array at the specified key and index.

WP_Customize_Setting::multidimensional_get( array $root, array $keys, mixed $default_value = null ) #

Will attempt to fetch a specific value from a multidimensional array.


Parameters

$root

(array)(Required)

$keys

(array)(Required)

$default_value

(mixed)(Optional)A default value which is used as a fallback.

Default value: null


Top ↑

Return

(mixed) The requested value or the default value.


Top ↑

Source

File: wp-includes/class-wp-customize-setting.php

	final protected function multidimensional_get( $root, $keys, $default_value = null ) {
		if ( empty( $keys ) ) { // If there are no keys, test the root.
			return isset( $root ) ? $root : $default_value;
		}

		$result = $this->multidimensional( $root, $keys );
		return isset( $result ) ? $result['node'][ $result['key'] ] : $default_value;
	}


Top ↑

Changelog

Changelog
VersionDescription
3.4.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.