Uses
Uses | Description |
---|---|
wp-includes/theme.php: get_theme_mod() | Retrieves theme modification value for the current theme. |
wp-includes/option.php: get_option() | Retrieves an option value based on an option name. |
Get the root value for a setting, especially for multidimensional ones.
(mixed) (Optional) Value to return if root does not exist.
Default value: null
(mixed)
File: wp-includes/class-wp-customize-setting.php
protected function get_root_value( $default = null ) { $id_base = $this->id_data['base']; if ( 'option' === $this->type ) { return get_option( $id_base, $default ); } elseif ( 'theme_mod' === $this->type ) { return get_theme_mod( $id_base, $default ); } else { /* * Any WP_Customize_Setting subclass implementing aggregate multidimensional * will need to override this method to obtain the data from the appropriate * location. */ return $default; } }
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/get_root_value