GC_Customize_Setting::get_root_value()

最后更新于:2021-11-27 08:31:50

GC_Customize_Setting::get_root_value( mixed$default=null)

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

参数

$default

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

Default value: null

响应

(mixed)

源文件

文件: gc-includes/class-gc-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 GC_Customize_Setting subclass implementing aggregate multidimensional
			 * will need to override this method to obtain the data from the appropriate
			 * location.
			 */
			return $default;
		}
	}