Hooks

Docs Hooks Pro · PHP hooks

modal_kit_pro_play_rate_limit

filter

Pro

PHP

Change how many game plays one address gets per hour, across every game on the site. 20 by default.

Runs on each play request (POST modal-kit-pro/v1/play) that carries a valid page token, before the game is looked up. One count per address covers every game, for an hour from its first play.

It’s separate from each game’s one play per visitor or per email, and from its daily coupon limit.

Parameters

Parameter

Description

$limit

int

Plays per address per hour: 20.

Returns

int The limit, cast to an integer. 0 or less refuses every play.

Example

A tablet on the shop counter

Every customer plays on the same device, so they all share one address.

PHP

add_filter( 'modal_kit_pro_play_rate_limit', function ( $limit ) {
  return max( $limit, 200 );
} );

Good to know

Over the limit, the visitor sees “Too many tries. Please wait a little.” (HTTP 429).

Visitors behind one proxy share an allowance until Pro knows their real address: see modal_kit_pro_visitor_address.

Applied in modal-kit-pro/includes/Games.php.

Need a hook that isn’t here?