WordPress at Your Fingertips
function is not described

WP_Customize_Setting::get_root_value() protected WP 4.4.0

Get the root value for a setting, especially for multidimensional ones.

{} It's a method of the class: WP_Customize_Setting{}

No Hooks.

Return

Mixed.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_root_value( $default );
$default(mixed)
Value to return if root does not exist.
Default: null

Changelog

Since 4.4.0 Introduced.

Code of WP_Customize_Setting::get_root_value() WP 5.8.1

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;
	}
}