WC_Settings_Tracking::add_option_to_list()publicWC 1.0

Add a WooCommerce option name to our allowed options list and attach the update_option Rather than inspecting every updated option and pattern matching for "woocommerce", just build a dynamic list for WooCommerce options that might get updated.

See woocommerce_update_option

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

Хуков нет.


null. Ничего.


$WC_Settings_Tracking = new WC_Settings_Tracking();
$WC_Settings_Tracking->add_option_to_list( $option );
$option(массив) (обязательный)
WooCommerce option (config) that might get updated.

Код WC_Settings_Tracking::add_option_to_list() WC 7.1.0

public function add_option_to_list( $option ) {
	$this->allowed_options[] = $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 );