wp_check_comment_disallowed_list
Action HookDescription
Fires before the comment is tested for disallowed characters or words.Hook Information
File Location |
wp-includes/comment.php
View on GitHub
|
Hook Type | Action |
Line Number | 1390 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$author
|
Comment author. |
string
|
$email
|
Comment author's email. |
string
|
$url
|
Comment author's URL. |
string
|
$comment
|
Comment content. |
string
|
$user_ip
|
Comment author's IP address. |
string
|
$user_agent
|
Comment author's browser user agent. |
Usage Examples
Basic Usage
<?php
// Hook into wp_check_comment_disallowed_list
add_action('wp_check_comment_disallowed_list', 'my_custom_function', 10, 6);
function my_custom_function($author, $email, $url, $comment, $user_ip, $user_agent) {
// Your custom code here
}
Source Code Context
wp-includes/comment.php:1390
- How this hook is used in WordPress core
<?php
1385 * @param string $url Comment author's URL.
1386 * @param string $comment Comment content.
1387 * @param string $user_ip Comment author's IP address.
1388 * @param string $user_agent Comment author's browser user agent.
1389 */
1390 do_action( 'wp_check_comment_disallowed_list', $author, $email, $url, $comment, $user_ip, $user_agent );
1391
1392 $mod_keys = trim( get_option( 'disallowed_keys' ) );
1393 if ( '' === $mod_keys ) {
1394 return false; // If moderation keys are empty.
1395 }
PHP Documentation
<?php
/**
* Fires before the comment is tested for disallowed characters or words.
*
* @since 5.5.0
*
* @param string $author Comment author.
* @param string $email Comment author's email.
* @param string $url Comment author's URL.
* @param string $comment Comment content.
* @param string $user_ip Comment author's IP address.
* @param string $user_agent Comment author's browser user agent.
*/
Quick Info
- Hook Type: Action
- Parameters: 6
- File: wp-includes/comment.php
Related Hooks
Related hooks will be displayed here in future updates.