transition_comment_status
Fires when the comment status is in transition.
Description
do_action( 'transition_comment_status', (int|string) $new_status, (int|string) $old_status, (object) $comment );
Parameters (3)
- 0. $new_status (int|string)
- The new comment status.
- 1. $old_status (int|string)
- The old comment status.
- 2. $comment (object)
- The comment data.
Usage
- To run the hook, copy the example below.
- // run the action
- do_action( 'transition_comment_status', $new_status, $old_status, $comment );
- The following example is for adding a hook callback.
- // define the transition_comment_status callback
- function action_transition_comment_status( $new_status, $old_status, $comment ) {
- // make action magic happen here...
- };
- // add the action
- add_action( 'transition_comment_status', 'action_transition_comment_status', 10, 3 );
- To remove a hook callback, use the example below.
- // remove the action
- remove_action( 'transition_comment_status', 'action_transition_comment_status', 10, 3 );
Defined (2)
The action is defined in the following location(s).
- /wp-includes/comment.php
- do_action( 'transition_comment_status', $new_status, $old_status, $comment );
- /wp-includes/default-filters.php
- add_action( 'transition_comment_status', '_clear_modified_cache_on_transition_comment_status', 10, 2 );