apply_filters( 'rest_preprocess_comment', array $prepared_comment, WP_REST_Request $request )

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.


Top ↑

Parameters

$prepared_comment array
The prepared comment data for wp_insert_comment.
$request WP_REST_Request
The current request.

Top ↑

Source

File: wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php. View all references

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


Top ↑

Changelog

Changelog
Version Description
4.7.0 Introduced.

Top ↑

User Contributed Notes

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