WooCommerce::schedule_tracking_action
Schedule the action to send tracking events if tracking is enabled.
Method of the class: WooCommerce{}
Hooks from the method
Returns
null. Nothing (null).
Usage
$WooCommerce = new WooCommerce(); $WooCommerce->schedule_tracking_action();
WooCommerce::schedule_tracking_action() WooCommerce::schedule tracking action code WC 10.9.1
public function schedule_tracking_action() {
if ( false === wc_string_to_bool( get_option( 'woocommerce_allow_tracking', 'no' ) ) ) {
return;
}
/**
* How frequent to schedule the tracker send event.
*
* @since 2.3.0
*/
$tracker_recurrence = apply_filters( 'woocommerce_tracker_event_recurrence', 'daily' );
$core_internals = wp_get_schedules();
as_schedule_recurring_action( time() + 10, $core_internals[ $tracker_recurrence ]['interval'], 'woocommerce_tracker_send_event_wrapper', array(), 'woocommerce', true );
}