wp_update_comment_count
Fires immediately after a post's comment count is updated in the database.
Использование
add_action( 'wp_update_comment_count', 'wp_kama_update_comment_count_action', 10, 3 );
/**
* Function for `wp_update_comment_count` action-hook.
*
* @param int $post_id Post ID.
* @param int $new The new comment count.
* @param int $old The old comment count.
*
* @return void
*/
function wp_kama_update_comment_count_action( $post_id, $new, $old ){
// action...
}
- $post_id(int)
- Post ID.
- $new(int)
- The new comment count.
- $old(int)
- The old comment count.
Список изменений
| С версии 2.3.0 | Введена. |
Где вызывается хук
wp-includes/comment.php 2827
do_action( 'wp_update_comment_count', $post_id, $new, $old );