apply_filters( 'allow_empty_comment', bool $allow_empty_comment, array $commentdata )

Filters whether an empty comment should be allowed.


Parameters

$allow_empty_comment bool
Whether to allow empty comments. Default false.
$commentdata array
Array of comment data to be sent to wp_insert_comment() .
More Arguments from wp_insert_comment( ... $commentdata ) Array of arguments for inserting a new comment.
  • comment_agentstring
    The HTTP user agent of the $comment_author when the comment was submitted. Default empty.
  • comment_approvedint|string
    Whether the comment has been approved. Default 1.
  • comment_authorstring
    The name of the author of the comment. Default empty.
  • comment_author_emailstring
    The email address of the $comment_author. Default empty.
  • comment_author_IPstring
    The IP address of the $comment_author. Default empty.
  • comment_author_urlstring
    The URL address of the $comment_author. Default empty.
  • comment_contentstring
    The content of the comment. Default empty.
  • comment_datestring
    The date the comment was submitted. To set the date manually, $comment_date_gmt must also be specified.
    Default is the current time.
  • comment_date_gmtstring
    The date the comment was submitted in the GMT timezone.
    Default is $comment_date in the site's GMT timezone.
  • comment_karmaint
    The karma of the comment. Default 0.
  • comment_parentint
    ID of this comment's parent, if any. Default 0.
  • comment_post_IDint
    ID of the post that relates to the comment, if any.
    Default 0.
  • comment_typestring
    Comment type. Default 'comment'.
  • comment_metaarray
    Optional. Array of key/value pairs to be stored in commentmeta for the new comment.
  • user_idint
    ID of the user who submitted the comment. Default 0.

Top ↑

Source

File: wp-includes/comment.php. View all references

$allow_empty_comment = apply_filters( 'allow_empty_comment', false, $commentdata );


Top ↑

Changelog

Changelog
Version Description
5.1.0 Introduced.

Top ↑

User Contributed Notes

You must log in before being able to contribute a note or feedback.