wphooks.info - pre_comment_approved

pre_comment_approved

(trunk - 5.1-alpha-44286)

The hook occurs in the following file:

wp-includes/comment.php:
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
	/**
	 * 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 shortcircuit comment insertion and
	 *              allow skipping further processing.
	 *
	 * @param bool|string|WP_Error $approved    The approval status. Accepts 1, 0, 'spam' or WP_Error.
	 * @param array                $commentdata Comment data.
	 */
	$approved = apply_filters( 'pre_comment_approved', $approved, $commentdata );
	return $approved;
}

/**
 * Hooks WP's native database-based comment-flood check.
 *
 * This wrapper maintains backward compatibility with plugins that expect to
 * be able to unhook the legacy check_comment_flood_db() function from
 * 'check_comment_flood' using remove_action().