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
Return
(mixed) The requested value or the default value.
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; }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
3.4.0 | Introduced. |