Filter hook 'pre_comment_approved'

in WP Core File wp-includes/comment.php at line 827

Description

Filters a comment's approval status before it is set. and allow skipping further processing.

Occurrences

Filename Line Number
wp-includes/comment.php 827

Parameters

Type Name Description
int|string|WP_Error $approved The approval status. Accepts 1, 0, 'spam', 'trash', or WP_Error.
array $commentdata Comment data.

PHP Doc

/**
	 * Filters a comment's approval status before it is set.
	 *
	 * @since 2.1.0
	 * @since 4.9.0 Returning a WP_Error value from the filter will short-circuit comment insertion
	 *              and allow skipping further processing.
	 *
	 * @param int|string|WP_Error $approved    The approval status. Accepts 1, 0, 'spam', 'trash',
	 *                                         or WP_Error.
	 * @param array               $commentdata Comment data.
	 */