apply_filters( ‘rest_preprocess_comment’, array $prepared_comment, WP_REST_Request $request )

In this article

Filters a comment added via the REST API after it is prepared for insertion into the database.

Description

Allows modification of the comment right after it is prepared for the database.

Parameters

$prepared_commentarray
The prepared comment data for wp_insert_comment.
$requestWP_REST_Request
The current request.

Source

return apply_filters( 'rest_preprocess_comment', $prepared_comment, $request );

Changelog

VersionDescription
4.7.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.