WP_Customize_Widgets::get_captured_option() WordPress Method

The WP_Customize_Widgets::get_captured_option() method is used to get the value for a specific captured setting. This setting must have been previously captured by the WP_Customize_Widgets::capture_option() method.

WP_Customize_Widgets::get_captured_option( string $option_name, mixed $default_value = false ) #

Retrieves the option that was captured from being saved.


Parameters

$option_name

(string)(Required)Option name.

$default_value

(mixed)(Optional) Default value to return if the option does not exist.

Default value: false


Top ↑

Return

(mixed) Value set for the option.


Top ↑

Source

File: wp-includes/class-wp-customize-widgets.php

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


Top ↑

Changelog

Changelog
VersionDescription
4.2.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More