WooCommerce::add_woocommerce_cleanup_rate_limits_wrapper
Wrapper for the woocommerce_cleanup_rate_limits This prevents the event failing when the class is not loaded. It loads the class if it exists, and then calls the actual action.
Method of the class: WooCommerce{}
Hooks from the method
Returns
null. Nothing (null).
Usage
$WooCommerce = new WooCommerce(); $WooCommerce->add_woocommerce_cleanup_rate_limits_wrapper();
WooCommerce::add_woocommerce_cleanup_rate_limits_wrapper() WooCommerce::add woocommerce cleanup rate limits wrapper code WC 10.7.0
public function add_woocommerce_cleanup_rate_limits_wrapper() {
try {
include_once WC_ABSPATH . 'includes/class-wc-rate-limiter.php';
if ( class_exists( WC_Rate_Limiter::class ) ) {
WC_Rate_Limiter::init();
}
} catch ( Throwable $e ) {
wc_get_logger()->error( 'Error in rate limiter cleanup wrapper: ' . $e->getMessage(), array( 'source' => 'woocommerce-scheduled-actions' ) );
}
// phpcs:disable WooCommerce.Commenting.CommentHooks.MissingHookComment
do_action( 'woocommerce_cleanup_rate_limits' );
}