Put cleanup hook attachment in an init method.
This commit is contained in:
parent
befa2b0a95
commit
5d182ee71a
|
@ -36,6 +36,13 @@ class WC_Rate_Limiter {
|
|||
*/
|
||||
const CACHE_GROUP = 'wc_rate_limit';
|
||||
|
||||
/**
|
||||
* Hook in methods.
|
||||
*/
|
||||
public static function init() {
|
||||
add_action( 'woocommerce_cleanup_rate_limits', array( __CLASS__, 'cleanup' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs key name from action identifier.
|
||||
* Left in for backwards compatibility.
|
||||
|
@ -162,3 +169,5 @@ class WC_Rate_Limiter {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
WC_Rate_Limiter::init();
|
||||
|
|
|
@ -2548,10 +2548,3 @@ function wc_cache_get_multiple( $keys, $group = '', $force = false ) {
|
|||
}
|
||||
return $values;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cleans up rate limit data - cron callback.
|
||||
*
|
||||
* @since 6.0.0
|
||||
*/
|
||||
add_action( 'woocommerce_cleanup_rate_limits', array( 'WC_Rate_Limiter', 'cleanup' ) );
|
||||
|
|
Loading…
Reference in New Issue