WP_Customize_Setting::multidimensional_replace
Will attempt to replace a specific value in a multidimensional array.
Method of the class: WP_Customize_Setting{}
No Hooks.
Returns
Mixed.
Usage
// protected - for code of main (parent) or child class $result = $this->multidimensional_replace( $root, $keys, $value );
- $root(array) (required)
- .
- $keys(array) (required)
- .
- $value(mixed) (required)
- The value to update.
Changelog
| Since 3.4.0 | Introduced. |
WP_Customize_Setting::multidimensional_replace() WP Customize Setting::multidimensional replace code WP 7.0
final protected function multidimensional_replace( $root, $keys, $value ) {
if ( ! isset( $value ) ) {
return $root;
} elseif ( empty( $keys ) ) { // If there are no keys, we're replacing the root.
return $value;
}
$result = $this->multidimensional( $root, $keys, true );
if ( isset( $result ) ) {
$result['node'][ $result['key'] ] = $value;
}
return $root;
}