wc_order_attribution_cookie_lifetime_months
Filter the lifetime of the cookie used for source tracking.
Usage
add_filter( 'wc_order_attribution_cookie_lifetime_months', 'wp_kama_wc_order_attribution_cookie_lifetime_months_filter' );
/**
* Function for `wc_order_attribution_cookie_lifetime_months` filter-hook.
*
* @param float $lifetime The lifetime of the Sourcebuster cookies in months.
The default value forces Sourcebuster into making the cookies valid for the current session only.
*
* @return float
*/
function wp_kama_wc_order_attribution_cookie_lifetime_months_filter( $lifetime ){
// filter...
return $lifetime;
}
- $lifetime(float)
- The lifetime of the Sourcebuster cookies in months.
The default value forces Sourcebuster into making the cookies valid for the current session only.
Changelog
| Since 8.5.0 | Introduced. |
Where the hook is called
wc_order_attribution_cookie_lifetime_months
woocommerce/src/Internal/Orders/OrderAttributionController.php 300
$lifetime = (float) apply_filters( 'wc_order_attribution_cookie_lifetime_months', 0.00001 );