Automattic\WooCommerce\Internal\Settings

OptionSanitizer::__construct()publicWC 1.0

OptionSanitizer constructor.

{} Это метод класса: OptionSanitizer{}

Хуков нет.

Возвращает

null. Ничего.

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

$OptionSanitizer = new OptionSanitizer();
$OptionSanitizer->__construct();

Код OptionSanitizer::__construct() WC 6.6.1

public function __construct() {
	// Sanitize color options.
	$color_options = array(
		'woocommerce_email_base_color',
		'woocommerce_email_background_color',
		'woocommerce_email_body_background_color',
		'woocommerce_email_text_color',
	);

	foreach ( $color_options as $option_name ) {
		add_filter(
			"woocommerce_admin_settings_sanitize_option_{$option_name}",
			function( $value, $option ) {
				return $this->sanitize_color_option( $value, $option );
			},
			10,
			2
		);
	}
}