transition_comment_status
Fires when the comment status is in transition.
Использование
add_action( 'transition_comment_status', 'wp_kama_transition_comment_status_action', 10, 3 );
/**
* Function for `transition_comment_status` action-hook.
*
* @param string $new_status The new comment status.
* @param string $old_status The old comment status.
* @param WP_Comment $comment Comment object.
*
* @return void
*/
function wp_kama_transition_comment_status_action( $new_status, $old_status, $comment ){
// action...
}
- $new_status(строка)
- The new comment status.
- $old_status(строка)
- The old comment status.
- $comment(WP_Comment)
- Comment object.
Список изменений
| С версии 2.7.0 | Введена. |
Где вызывается хук
transition_comment_status
wp-includes/comment.php 1898
do_action( 'transition_comment_status', $new_status, $old_status, $comment );
Где используется хук в WordPress
wp-includes/default-filters.php 325
add_action( 'transition_comment_status', '_clear_modified_cache_on_transition_comment_status', 10, 2 );