This article contains PHP code and is intended for developers. We offer this code as a courtesy, but don't provide support for code customizations or 3rd party development.
Use this hook to filter the denylist data.
Usage
add_filter( 'frm_denylist_data', 'filter_denylist_data' );
Parameters
- $denylist_data (array): An array of denylist. To see the details of a denylist, please check the FrmSpamCheckDenylist:fill_default_denylist_data() method.
Examples
Add custom denylist for the URL field
add_filter( 'frm_denylist_data', function( $denylist_data ) {
$denylist_data[] = array(
'file' => 'path_to_denied_urls_file',
'field_types' => array( 'url' ),
);
return $denylist_data;
});
Skip disallowed words for logged-in users and checkboxes
Use this code example to skip the custom disallowed words settings for logged-in users and checkbox fields.
add_filter( 'frm_denylist_data', function( $denylist_data ) {
$denylist_data['custom']['skip'] = is_user_logged_in();
$denylist_data['custom']['skip_field_types'] = array( 'checkbox' );
return $denylist_data;
});