W3cubDocs

/WordPress

apply_filters( 'pre_comment_approved', int|string|WP_Error $approved, array $commentdata )

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

Parameters

$approved

(int|string|WP_Error) The approval status. Accepts 1, 0, 'spam', 'trash', or WP_Error.

$commentdata

(array) Comment data.

Source

File: wp-includes/comment.php

View on Trac

Changelog

Version Description
4.9.0 Returning a WP_Error value from the filter will short-circuit comment insertion and allow skipping further processing.
2.1.0 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/pre_comment_approved