WooCommerce::get_tracking_history()publicWC .

Tracks the history WooCommerce Allow Tracking option.

  • When the field was first set to allow tracking
  • Last time the option was changed

Method of the class: WooCommerce{}

No Hooks.

Return

null. Nothing (null).

Usage

$WooCommerce = new WooCommerce();
$WooCommerce->get_tracking_history( $old_value, $value );
$old_value(string) (required)
The old value for the woocommerce_allow_tracking option.
$value(string) (required)
The current value for the woocommerce_allow_tracking option.

Changelog

Since . Introduced.
Since x.x.x

WooCommerce::get_tracking_history() code WC 9.7.1

public function get_tracking_history( $old_value, $value ) {
	// If woocommerce_allow_tracking_first_optin is not set. It means is the first time it gets set.
	if ( ! get_option( 'woocommerce_allow_tracking_first_optin' ) && 'yes' === $value ) {
		update_option( 'woocommerce_allow_tracking_first_optin', time() );
	}

	// Always update the last change.
	update_option( 'woocommerce_allow_tracking_last_modified', time() );
}