WP_Customize_Widgets::capture_filter_pre_get_option()publicWP 3.9.0

Pre-filters captured option values before retrieving.

Метод класса: WP_Customize_Widgets{}

Хуки из метода

Возвращает

Разное. Filtered option value.

Использование

$WP_Customize_Widgets = new WP_Customize_Widgets();
$WP_Customize_Widgets->capture_filter_pre_get_option( $value );
$value(разное) (обязательный)
Value to return instead of the option value.

Список изменений

С версии 3.9.0 Введена.

Код WP_Customize_Widgets::capture_filter_pre_get_option() WP 6.5.2

public function capture_filter_pre_get_option( $value ) {
	$option_name = preg_replace( '/^pre_option_/', '', current_filter() );

	if ( isset( $this->_captured_options[ $option_name ] ) ) {
		$value = $this->_captured_options[ $option_name ];

		/** This filter is documented in wp-includes/option.php */
		$value = apply_filters( 'option_' . $option_name, $value, $option_name );
	}

	return $value;
}