WordPress at Your Fingertips
filter is not described

rest_preprocess_comment filter-hook . WP 4.7.0

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

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


add_filter( 'rest_preprocess_comment', 'filter_function_name_2572', 10, 2 );
function filter_function_name_2572( $prepared_comment, $request ){
	// filter...

	return $prepared_comment;
The prepared comment data for wp_insert_comment.
The current request.


Since 4.7.0 Introduced.

Where the hook is called

wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php 1363
return apply_filters( 'rest_preprocess_comment', $prepared_comment, $request );

Where in WP core the hook is used WordPress

Usage not found.