WooCommerce Code Reference

WC_Settings_Tracking
in package

This class adds actions to track usage of WooCommerce Settings.

Table of Contents

$allowed_options  : array
List of allowed WooCommerce settings to potentially track updates for.
$updated_options  : array
WooCommerce settings that have been updated (and will be tracked).
add_option_to_list()  : mixed
Add a WooCommerce option name to our allowed options list and attach the `update_option` hook. Rather than inspecting every updated option and pattern matching for "woocommerce", just build a dynamic list 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_list()

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

public add_option_to_list(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