rest_delete_comment
Fires after a comment is deleted via the REST API.
Использование
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.
Список изменений
С версии 4.7.0 | Введена. |
Где вызывается хук
rest_delete_comment
wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php 1025
do_action( 'rest_delete_comment', $comment, $response, $request );