Function Reference/check comment
Description
check_comment() checks whether a comment passes internal checks set by WordPress Comment_Moderation.
Usage
<?php check_comment( $author, $email, $url, $comment, $user_ip, $user_agent, $comment_type ) ?>
Parameters
- $author
- (string) (required) Comment author name.
- Default: None
- $email
- (string) (required) Comment author email.
- Default: None
- $url
- (string) (required) Comment author URL.
- Default: None
- $comment
- (string) (required) Comment contents.
- Default: None
- $user_ip
- (string) (required) Comment author IP address.
- Default: None
- $user_agent
- (string) (required) Comment author user agent.
- Default: None
- $comment_type
- (string) (required) Comment type (comment, trackback, or pingback).
- Default: None
Return Values
- (boolean)
- This function returns a single boolean value of either true or false.
Returns false if in Comment_Moderation:
- The Administrator must approve all messages,
- The number of external links is too high, or
- Any banned word, name, URL, e-mail, or IP is found in any parameter except $comment_type.
Returns true if the Administrator does not have to approve all messages and:
- $comment_type parameter is a trackback or pingback and part of the blogroll, or
- $author and $email parameters have been approved previously.
Returns true in all other cases.
Examples
Notes
Change Log
- Since: WordPress Version 1.2
Source File
check_comment() is located in wp-includes/comment.php.
Related