Automattic\WooCommerce\Admin\API\RateLimits
QRLoginRateLimits::get_action_id
Build the persisted rate-limit action ID.
Method of the class: QRLoginRateLimits{}
No Hooks.
Returns
string.
Usage
$result = QRLoginRateLimits::get_action_id( $bucket, $identifier ): string;
- $bucket(string) (required)
- Bucket name.
- $identifier(string) (required)
- Bucket identifier.
QRLoginRateLimits::get_action_id() QRLoginRateLimits::get action id code WC 11.0.1
public static function get_action_id( string $bucket, string $identifier ): string {
$normalized_identifier = preg_replace( '/[^A-Za-z0-9:._-]/', '_', trim( $identifier ) );
$normalized_identifier = is_string( $normalized_identifier ) && '' !== $normalized_identifier
? $normalized_identifier
: 'unknown';
return substr( self::KEY_PREFIX . $bucket . '_' . $normalized_identifier, 0, 190 );
}