Core Function
View Source on Trac ↗ wp_allow_comment()
wp_allow_comment( mixed $commentdata, mixed $wp_error = false ) Validates whether this comment is allowed to be made.
Parameters 2 required
| Name / Type | Description |
|---|---|
| $commentdata array | Contains information on the comment. Required |
| bool | $wp_error When true, a disallowed comment will result in the function returning a WP_Error object, rather than executing wp_die(). Default false. Required |
Return Value
((int)
(int | string | WP_Error) Allowed comments return the approval status (0|1|'spam'|'trash').
If `$wp_error` is true, disallowed comments return a WP_Error.
Function Information
Since Version
2.0.0
Source File
wp-includes/comment.php
Advertisement