Used By
Used By | Description |
---|---|
wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php: WP_REST_Comments_Controller::create_item() | Creates a comment. |
Filters a comment before it is inserted via the REST API.
Allows modification of the comment right before it is inserted via wp_insert_comment(). Returning a WP_Error value from the filter will short-circuit insertion and allow skipping further processing.
(array|WP_Error) The prepared comment data for wp_insert_comment().
(WP_REST_Request) Request used to insert the comment.
File: wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php
Version | Description |
---|---|
4.8.0 | $prepared_comment can now be a WP_Error to short-circuit insertion. |
4.7.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/rest_pre_insert_comment