gform_recaptcha_enterprise_keys_page_size

Description

reCAPTCHA’s Enterprise API can only retrieve 100 reCAPTCHA keys at a time. The gform_recaptcha_enterprise_keys_page_size filter allows developers to set the page size to something smaller.

Usage

add_filter( 'gform_recaptcha_enterprise_keys_page_size', 'my_custom_page_size' );

Parameters

ParameterTypeDescription
$page_sizeintegerThe number of reCAPTCHA Enterprise keys to retrieve in each API call. The default is 100 and the maximum allowed per API call is 100.

Examples

Decrease page size to 25 per API call

add_filter( 'gform_recaptcha_enterprise_keys_page_size', function( $page_size ) {
	return 25; // or whatever number of keys you want the API to retrieve before making additional requests. Max 100
} );

Additional Information

You can also set the reCAPTCHA API Enterprise keys using constants in your wp-config.php. See this article for more information.

Source Code

This filter is located in includes/class-recaptcha-api.php

Since

reCAPTCHA Add-On v1.8.0