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.
This hook can be used to validate that uploaded file is not obviously spam.
Usage
apply_filters( 'frm_filename_spam_keywords', 'my_custom_function' );
Parameters
- $spam_keywords (array) by default it contains the following keywords fortnite, vbucks, roblox, robux
Examples
Add a new keyword to classify it as spam
This example will add a new keyword to a blacklist to classify it as spam
add_filter( 'frm_filename_spam_keywords', 'my_custom_function' );
function my_custom_function( $spam_keywords ) {
array_push( $spam_keywords, 'another' );
return $spam_keywords;
}
Replace the keyword 'another' with the one you need to add
Remove one of the default keywords classified as spam
This example will remove one of the default keywords classified as spam
add_filter( 'frm_filename_spam_keywords', 'my_custom_function' );
function my_custom_function( $spam_keywords ) {
$key = array_search( 'robux', $spam_keywords ); // Replace the keyword 'robux' with the one you need to remove
if ( false !== $key ) {
unset( $spam_keywords[ $key ] );
}
return $spam_keywords;
}
Currently these are the default keywords fortnite, vbucks, roblox, robux
Disable spam validation for this hook
This example will disable the spam validation for this hook
add_filter( 'frm_filename_spam_keywords', '__return_false' );