Automattic\WooCommerce\Internal\Settings

OptionSanitizer::__construct()publicWC 1.0

OptionSanitizer constructor.

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

Хуков нет.

Возвращает

null. Ничего (null).

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

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

Код OptionSanitizer::__construct() WC 9.0.2

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 ) {
		self::add_filter(
			"woocommerce_admin_settings_sanitize_option_{$option_name}",
			array( $this, 'sanitize_color_option' ),
			10,
			2
		);
	}
	// Cast "Out of stock threshold" field to absolute integer to prevent storing empty value.
	self::add_filter( 'woocommerce_admin_settings_sanitize_option_woocommerce_notify_no_stock_amount', 'absint' );
}