rest_delete_comment
Fires after a comment is deleted via the REST API.
Description
Parameters (3)
- 0. $comment (WP_Comment)
- The deleted comment data.
- 1. $response (WP_REST_Response)
- The response returned from the API.
- 2. $request (WP_REST_Request)
- The request sent to the API.
Usage
- To run the hook, copy the example below.
- // run the action
- do_action( 'rest_delete_comment', $comment, $response, $request );
- The following example is for adding a hook callback.
- // define the rest_delete_comment callback
- function action_rest_delete_comment( $comment, $response, $request ) {
- // make action magic happen here...
- };
- // add the action
- add_action( 'rest_delete_comment', 'action_rest_delete_comment', 10, 3 );
- To remove a hook callback, use the example below.
- // remove the action
- remove_action( 'rest_delete_comment', 'action_rest_delete_comment', 10, 3 );
Defined (1)
The action is defined in the following location(s).
- /wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php
- do_action( 'rest_delete_comment', $comment, $response, $request );