等待你刚才说了吗get_comment_ancestors() 做not 存在他们在想什么。。。
我们可以通过在整个注释线程中循环,直到找到顶级注释。我们通过parent_comment 正在设置为0:
/**
 * Return the top parent comment ID
 * 
 * @param $comment_id
 * @return comment id
 */
function cc_get_top_level_comment_id_wpse_265978($comment_id){
    if (!is_numeric($comment_id)) return;
    $parent_comment_id = 1;
    // loop comment thread until we find the one which has parent comment ID set to 0
    while($parent_comment_id > 0) {
        $comment = get_comment($comment_id);
        $comment_current_id = $comment->comment_ID;
        $parent_comment_id = $comment->comment_parent;
        $comment_id = $parent_comment_id;
    }
    return $comment_current_id;
}