WordPress at a glance
filter is not described

pre_comment_approved filter-hook . WP 2.1.0

Filters a comment's approval status before it is set.

Usage

add_filter( 'pre_comment_approved', 'filter_function_name_5477', 10, 2 );
function filter_function_name_5477( $approved, $commentdata ){
	// filter...

	return $approved;
}
$approved(true/false/string/WP_Error)
The approval status. Accepts 1, 0, 'spam' or WP_Error.
$commentdata(array)
Comment data.

Notes

  • Since 4.9.0 Returning a WP_Error value from the filter will shortcircuit comment insertion and
    allow skipping further processing.

Where the hook is called

wp_allow_comment()
wp-includes/comment.php 780
$approved = apply_filters( 'pre_comment_approved', $approved, $commentdata );

Where the hook is used (in WP core)

Does not used.