WC_Settings_Tracking
in package
This class adds actions to track usage of WooCommerce Settings.
Table of Contents
- $allowed_options : array<string|int, mixed>
- List of allowed WooCommerce settings to potentially track updates for.
- $updated_options : array<string|int, mixed>
- 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
$allowed_options
List of allowed WooCommerce settings to potentially track updates for.
protected
array<string|int, mixed>
$allowed_options
= array()
$updated_options
WooCommerce settings that have been updated (and will be tracked).
protected
array<string|int, mixed>
$updated_options
= array()
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<string|int, mixed> $option) : mixed
See woocommerce_update_option
hook.
Parameters
- $option : array<string|int, mixed>
-
WooCommerce option (config) that might get updated.
Return values
mixed —init()
Init tracking.
public
init() : mixed
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_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 —track_settings_page_view()
Send a Tracks event for WooCommerce settings page views.
public
track_settings_page_view() : mixed