Automattic\WooCommerce\Internal\Settings

OptionSanitizer::__construct()publicWC 1.0

OptionSanitizer constructor.

{} It's a method of the class: OptionSanitizer{}

No Hooks.

Return

null. Nothing.

Usage

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

Code of OptionSanitizer::__construct() WC 7.1.0

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