delete_comment
Fires immediately before a comment is deleted from the database.
Description
Parameters (1)
- 0. $comment_comment_id (int)
- The comment comment id.
Usage
- To run the hook, copy the example below.
- // run the action
- do_action( 'delete_comment', $comment_comment_id );
- The following example is for adding a hook callback.
- // define the delete_comment callback
- function action_delete_comment( $comment_comment_id ) {
- // make action magic happen here...
- };
- // add the action
- add_action( 'delete_comment', 'action_delete_comment', 10, 1 );
- To remove a hook callback, use the example below.
- // remove the action
- remove_action( 'delete_comment', 'action_delete_comment', 10, 1 );
Defined (1)
The action is defined in the following location(s).
- /wp-includes/comment.php
- do_action( 'delete_comment', $comment->comment_ID );