WooCommerce Code Reference

Search results

WC_Settings_Tracking

This class adds actions to track usage of WooCommerce Settings.

Table of Contents

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

Properties

$whitelist

Whitelisted WooCommerce settings to potentially track updates for.

protected array $whitelist = array()

$updated_options

WooCommerce settings that have been updated (and will be tracked).

protected array $updated_options = array()

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( $option : array ) : 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( $option_name : string , $old_value : mixed , $new_value : mixed ) : 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

send_settings_change_event()

Send a Tracks event for WooCommerce options that changed values.

public send_settings_change_event( ) : mixed
Return values
mixed

track_settings_page_view()

Send a Tracks event for WooCommerce settings page views.

public track_settings_page_view( ) : mixed
Return values
mixed
Back to the top