WC_Rate_Limiter::set_rate_limit( string $action_id, int $delay )

Sets the rate limit delay in seconds for action with identifier $id.


Description Description


Parameters Parameters

$action_id

(Required) Identifier of the action.

$delay

(Required) Delay in seconds.


Top ↑

Return Return

(bool) True if the option setting was successful, false otherwise.


Top ↑

Source Source

File: includes/class-wc-rate-limiter.php

	public static function set_rate_limit( $action_id, $delay ) {
		$option_name         = self::storage_id( $action_id );
		$next_try_allowed_at = time() + $delay;
		return update_option( $option_name, $next_try_allowed_at );
	}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.