WP_Customize_Widgets::get_captured_option()protectedWP 4.2.0

Retrieves the option that was captured from being saved.

Method of the class: WP_Customize_Widgets{}

No Hooks.

Returns

Mixed. Value set for the option.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_captured_option( $option_name, $default_value );
$option_name(string) (required)
Option name.
$default_value(mixed)
Default false.
Default: value to return if the option does not exist

Changelog

Since 4.2.0 Introduced.

WP_Customize_Widgets::get_captured_option() code WP 6.8.1

protected function get_captured_option( $option_name, $default_value = false ) {
	if ( array_key_exists( $option_name, $this->_captured_options ) ) {
		$value = $this->_captured_options[ $option_name ];
	} else {
		$value = $default_value;
	}
	return $value;
}