WP_Customize_Setting::multidimensional_replace PHP Method

multidimensional_replace() final protected method

Will attempt to replace a specific value in a multidimensional array.
Since: 3.4.0
final protected multidimensional_replace ( $root, $keys, mixed $value ) : mixed
$root
$keys
$value mixed The value to update.
return mixed
    protected final 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;
    }