WP_Customize_Setting::set_root_value PHP Method

set_root_value() protected method

Set the root value for a setting, especially for multidimensional ones.
Since: 4.4.0
protected set_root_value ( mixed $value ) : boolean
$value mixed Value to set as root of multidimensional setting.
return boolean Whether the multidimensional root was updated successfully.
    protected function set_root_value($value)
    {
        $id_base = $this->id_data['base'];
        if ('option' === $this->type) {
            $autoload = true;
            if (isset(self::$aggregated_multidimensionals[$this->type][$this->id_data['base']]['autoload'])) {
                $autoload = self::$aggregated_multidimensionals[$this->type][$this->id_data['base']]['autoload'];
            }
            return update_option($id_base, $value, $autoload);
        } else {
            if ('theme_mod') {
                set_theme_mod($id_base, $value);
                return true;
            } else {
                /*
                 * Any WP_Customize_Setting subclass implementing aggregate multidimensional
                 * will need to override this method to obtain the data from the appropriate
                 * location.
                 */
                return false;
            }
        }
    }