pre_comment_approved

Advertisement

Summery Summery

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

Syntax Syntax

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

Parameters Parameters

$approved

The approval status. Accepts 1, 0, 'spam', 'trash', or WP_Error.

$commentdata

Comment data.

Source Source

File: wp-includes/comment.php

Advertisement

Changelog Changelog

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

Advertisement

Leave a Reply