On this page
WP_Customize_Setting::multidimensional_replace( array $root, array $keys, mixed $value ): mixed
Will attempt to replace a specific value in a multidimensional array.
Parameters
$rootarray Required$keysarray Required$valuemixed Required-
The value to update.
Return
mixed
Source
File: wp-includes/class-wp-customize-setting.php. View all references
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;
}
Related
Uses
| Uses | Description |
|---|---|
| WP_Customize_Setting::multidimensional() wp-includes/class-wp-customize-setting.php | Multidimensional helper function. |
Used By
| Used By | Description |
|---|---|
| WP_Customize_Setting::update() wp-includes/class-wp-customize-setting.php | Save the value of the setting, using the related API. |
Changelog
| Version | Description |
|---|---|
| 3.4.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_customize_setting/multidimensional_replace