Automattic\WooCommerce\StoreApi\Utilities

RateLimits::is_exceeded_retry_after()public staticWC 1.0

If exceeded, seconds until reset.

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

Хуков нет.

Возвращает

true|false|int.

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

$result = RateLimits::is_exceeded_retry_after( $action_id );
$action_id(строка) (обязательный)
Identifier of the action.

Код RateLimits::is_exceeded_retry_after() WC 7.3.0

public static function is_exceeded_retry_after( $action_id ) {
	$current_limit = self::get_rate_limit( $action_id );

	// Before the next run is allowed, retry forbidden.
	if ( time() <= $current_limit->reset && 0 === $current_limit->remaining ) {
		return (int) $current_limit->reset - time();
	}

	// After the next run is allowed, retry allowed.
	return false;
}