Description
Filter the types of rules available for selection when configuring Limit Submission feeds.
Usage
add_filter( 'gpls_rule_type_choices', 'my_custom_function' );
Parameters
choices array
An array of rule types (e.g. IP, User, Embed URL, Role, Field Value).
Since
This filter is available since Gravity Forms Limit Submissions 1.0.8.
Examples
Only allow some rule types.
add_filter( 'gpls_rule_type_choices', function( $choices ) {
// Supports "ip", "user", "embed_url", "role", "value".
$allowed_rule_types = array( 'ip', 'user', 'role' );
$filtered_choices = array();
foreach ( $choices as $choice ) {
if ( in_array( $choice['value'], $allowed_rule_types ) ) {
$filtered_choices[] = $choice;
}
}
return $filtered_choices;
} );