comment_on_draft
Fires when a comment is attempted on a post in draft mode.
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_draft', $comment_post_id );
- The following example is for adding a hook callback.
- // define the comment_on_draft callback
- function action_comment_on_draft( $comment_post_id ) {
- // make action magic happen here...
- };
- // add the action
- add_action( 'comment_on_draft', 'action_comment_on_draft', 10, 1 );
- To remove a hook callback, use the example below.
- // remove the action
- remove_action( 'comment_on_draft', 'action_comment_on_draft', 10, 1 );
Defined (1)
The action is defined in the following location(s).
- /wp-includes/comment.php
- do_action( 'comment_on_draft', $comment_post_ID );