On this page
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.
Parameters
$prepared_commentarray-
The prepared comment data for
wp_insert_comment. $requestWP_REST_Request-
The current request.
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 );
Related
Used By
| Used By | Description |
|---|---|
| WP_REST_Comments_Controller::prepare_item_for_database() wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php | Prepares a single comment to be inserted into the database. |
Changelog
| Version | Description |
|---|---|
| 4.7.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/rest_preprocess_comment