wp_blacklist_check [ WordPress Function ]
wp_blacklist_check ( $author, $email, $url, $comment, $user_ip, $user_agent )
| Parameters: |
|
| Uses: | |
| Returns: |
|
| Defined at: |
|
Soorgelijke functies: wp_list_pluck, wp_list_cats, wp_list_comments, wp_version_check, wp_list_pages
Does comment contain blacklisted characters or words.
Source
<?php
function wp_blacklist_check($author, $email, $url, $comment, $user_ip, $user_agent) {
do_action('wp_blacklist_check', $author, $email, $url, $comment, $user_ip, $user_agent);
$mod_keys = trim( get_option('blacklist_keys') );
if ( '' == $mod_keys )
return false; // If moderation keys are empty
$words = explode("\n", $mod_keys );
foreach ( (array) $words as $word ) {
$word = trim($word);
// Skip empty lines
if ( empty($word) ) { continue; }
// Do some escaping magic so that '#' chars in the
// spam words don't break things:
$word = preg_quote($word, '#');
$pattern = "#$word#i";
if (
preg_match($pattern, $author)
|| preg_match($pattern, $email)
|| preg_match($pattern, $url)
|| preg_match($pattern, $comment)
|| preg_match($pattern, $user_ip)
|| preg_match($pattern, $user_agent)
)
return true;
}
return false;
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- wp_blacklist_check Wordpress hook details -- Adam Brown, BYU ...
WordPress hook directory wp_blacklist_check. Description. Runs to check whether a comment should be blacklisted. Action function arguments: author name, ...
adambrown.info - wp_blacklist_check() WordPress function reference, arguments and ...
Does comment contain blacklisted characters or words.
queryposts.com - #9965 (wp_blacklist_check() spams comments containing decimal ...
As noted in the conversation on #9934. Decimal entities cause the comment to unconditionally be marked as spam. Hex entities are allowed, however. Should ...
core.trac.wordpress.org - Docs for page comment.php
bool wp_blacklist_check (string $author, string $email, string $url, string $ comment, string $user_ip, string $user_agent). string $author: The author of the ...
phpdoc.wordpress.org