WooCommerce Code Reference

WC_Settings_Tracking
in package

This class adds actions to track usage of WooCommerce Settings.

Table of Contents

$updated_options  : array
WooCommerce settings that have been updated (and will be tracked).
$whitelist  : array
Whitelisted WooCommerce settings to potentially track updates for.
add_option_to_whitelist()  : mixed
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.
init()  : mixed
Init tracking.
send_settings_change_event()  : mixed
Send a Tracks event for WooCommerce options that changed values.
track_setting_change()  : mixed
Add WooCommerce option to a list of updated options.
track_settings_page_view()  : mixed
Send a Tracks event for WooCommerce settings page views.

Properties

Methods

add_option_to_whitelist()

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.

public add_option_to_whitelist(array $option) : mixed

See woocommerce_update_option hook.

Parameters
$option : array

WooCommerce option (config) that might get updated.

Return values
mixed

track_setting_change()

Add WooCommerce option to a list of updated options.

public track_setting_change(string $option_name, mixed $old_value, mixed $new_value) : mixed
Parameters
$option_name : string

Option being updated.

$old_value : mixed

Old value of option.

$new_value : mixed

New value of option.

Return values
mixed