Uses
Uses | Description |
---|---|
wp-includes/theme.php: set_theme_mod() | Updates theme modification value for the current theme. |
wp-includes/option.php: update_option() | Updates the value of an option that was already added. |
Set the root value for a setting, especially for multidimensional ones.
(mixed) (Required) Value to set as root of multidimensional setting.
(bool) Whether the multidimensional root was updated successfully.
File: wp-includes/class-wp-customize-setting.php
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 ); } elseif ( 'theme_mod' === $this->type ) { 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; } }
Version | Description |
---|---|
4.4.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_customize_setting/set_root_value