comment_on_trash
Fires when a comment is attempted on a trashed post.
Description
Parameters (1)
- 0. $comment_post_id (int)
- The comment post id.
Usage
- To run the hook, copy the example below.
- // run the action
- do_action( 'comment_on_trash', $comment_post_id );
- The following example is for adding a hook callback.
- // define the comment_on_trash callback
- function action_comment_on_trash( $comment_post_id ) {
- // make action magic happen here...
- };
- // add the action
- add_action( 'comment_on_trash', 'action_comment_on_trash', 10, 1 );
- To remove a hook callback, use the example below.
- // remove the action
- remove_action( 'comment_on_trash', 'action_comment_on_trash', 10, 1 );
Defined (1)
The action is defined in the following location(s).
- /wp-includes/comment.php
- do_action( 'comment_on_trash', $comment_post_ID );