public
Last active

Benutzerdefinierte WordPress-Filter für das Antispam Bee Plugin. Spam-Markierung anhand von Regulären Ausdrücken.

  • Download Gist
functions.php
PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
<?php
 
/*
Antispam Bee filter for custom RegExp patterns
Customize and paste it into functions.php
*/
 
add_action(
'init',
'antispam_bee_patterns'
);
 
function antispam_bee_patterns() {
add_filter(
'antispam_bee_patterns',
'antispam_bee_add_custom_patterns'
);
}
function antispam_bee_add_custom_patterns($patterns) {
/* Pattern for evil email address */
$patterns[] = array(
'email' => '@spam-mail.com$'
);
 
/* Pattern with more properties ...
$patterns[] = array(
'ip' => '^200\.',
'host' => '^\d+\w+\.com$',
'body' => '^\w+\s\d+$',
'email' => '@gmail.com$',
'author' => 'www\.\w+\.\w{2,}'
); */
 
return $patterns;
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.