WP_Customize_Setting::get_root_value( mixed $default = null )

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


Description Description


Parameters Parameters

$default

(mixed) (Optional) Value to return if root does not exist.

Default value: null


Top ↑

Return Return

(mixed)


Top ↑

Source Source

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

Top ↑

Changelog Changelog

Changelog
Version Description
4.4.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.