WordPress Hooks Explorer

Listing all hooks extracted WordPress Core


Details about rest_pre_insert_comment

Back to home

Files

Filename Hook Type Line Number PHP Doc
wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php apply_filters 696 /**
* 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.
*
* @since 4.7.0
* @since 4.8.0 `$prepared_comment` can now be a WP_Error to short-circuit insertion.
*
* @param array|WP_Error $prepared_comment The prepared comment data for wp_insert_comment().
* @param WP_REST_Request $request Request used to insert the comment.
*/

Hook Parameters

Parameter Type Name Description
array|WP_Error $prepared_comment The prepared comment data for wp_insert_comment().
WP_REST_Request $request Request used to insert the comment.