WC_Rate_Limiter::retried_too_soon() public WC 1.0
Returns true if the action is not allowed to be run by the rate limiter yet, false otherwise.
{} Это метод класса: WC_Rate_Limiter{}
Хуков нет.
Возвращает
true/false.
Использование
$result = WC_Rate_Limiter::retried_too_soon( $action_id );
- $action_id(строка) (обязательный)
- Identifier of the action.
Код WC_Rate_Limiter::retried_too_soon() WC Rate Limiter::retried too soon WC 5.0.0
public static function retried_too_soon( $action_id ) {
$next_try_allowed_at = get_option( self::storage_id( $action_id ) );
// No record of action running, so action is allowed to run.
if ( false === $next_try_allowed_at ) {
return false;
}
// Before the next run is allowed, retry forbidden.
if ( time() <= $next_try_allowed_at ) {
return true;
}
// After the next run is allowed, retry allowed.
return false;
}