W3cubDocs

/WordPress

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

Filters a comment after it is prepared for the database.

Description

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

Parameters

$prepared_comment

(array) The prepared comment data for wp_insert_comment.

$request

(WP_REST_Request) The current request.

Source

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

View on Trac

Changelog

Version Description
4.7.0 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/rest_preprocess_comment