Automattic\WooCommerce\StoreApi\Utilities

RateLimits::set_cacheprotected staticWC 1.0

Cache a rate limit.

Метод класса: RateLimits{}

Хуков нет.

Возвращает

true|false.

Использование

$result = RateLimits::set_cache( $action_id, $current_limit ): bool;
$action_id(строка) (обязательный)
Identifier of the action.
$current_limit(объект) (обязательный)
Current limit object with expiry and retries remaining.

Код RateLimits::set_cache() WC 10.5.2

protected static function set_cache( $action_id, $current_limit ): bool {
	return wp_cache_set( self::get_cache_key( $action_id ), $current_limit, self::CACHE_GROUP );
}