GC_Customize_Setting::multidimensional_replace()
最后更新于:2021-11-27 08:43:46
GC_Customize_Setting::multidimensional_replace( array$root, array$keys, mixed$value)Will attempt to replace a specific value in a multidimensional array.
参数
- $root
-
(array) (Required)
- $keys
-
(array) (Required)
- $value
-
(mixed) (Required) The value to update.
响应
(mixed)
源文件
文件: gc-includes/class-gc-customize-setting.php
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;
}