rest_delete_comment action-hookWP 4.7.0

Fires after a comment is deleted via the REST API.

Usage

add_action( 'rest_delete_comment', 'wp_kama_rest_delete_comment_action', 10, 3 );

/**
 * Function for `rest_delete_comment` action-hook.
 * 
 * @param WP_Comment       $comment  The deleted comment data.
 * @param WP_REST_Response $response The response returned from the API.
 * @param WP_REST_Request  $request  The request sent to the API.
 *
 * @return void
 */
function wp_kama_rest_delete_comment_action( $comment, $response, $request ){

	// action...
}
$comment(WP_Comment)
The deleted comment data.
$response(WP_REST_Response)
The response returned from the API.
$request(WP_REST_Request)
The request sent to the API.

Changelog

Since 4.7.0 Introduced.

Where the hook is called

WP_REST_Comments_Controller::delete_item()
rest_delete_comment
wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php 1025
do_action( 'rest_delete_comment', $comment, $response, $request );

Where the hook is used in WordPress

Usage not found.