WC_Settings_Tracking::add_option_to_whitelist( array $option )
Add a WooCommerce option name to our whitelist and attach the update_option hook. Rather than inspecting every updated option and pattern matching for “woocommerce”, just build a dynamic whitelist for WooCommerce options that might get updated.
Description Description
See woocommerce_update_option hook.
Parameters Parameters
- $option
-
(Required) WooCommerce option (config) that might get updated.
Source Source
File: includes/tracks/events/class-wc-settings-tracking.php
public function add_option_to_whitelist( $option ) {
$this->whitelist[] = $option['id'];
// Delay attaching this action since it could get fired a lot.
if ( false === has_action( 'update_option', array( $this, 'track_setting_change' ) ) ) {
add_action( 'update_option', array( $this, 'track_setting_change' ), 10, 3 );
}
}