wp_update_comment_count example


    do_action( 'deleted_comment', $comment->comment_ID, $comment );

    $post_id = $comment->comment_post_ID;
    if ( $post_id && 1 == $comment->comment_approved ) {
        wp_update_comment_count( $post_id );
    }

    clean_comment_cache( $comment->comment_ID );

    /** This action is documented in wp-includes/comment.php */
    do_action( 'wp_set_comment_status', $comment->comment_ID, 'delete' );

    wp_transition_comment_status( 'delete', $comment->comment_approved, $comment );

    return true;
}

Home | Imprint | This part of the site doesn't use cookies.