Exclude child comments in get_comments() or WP_Comment_Query?

Question

How do I only get the first level of comments in get_comments() or WP_Comment_Query?
I want to query the comments which have ‘comment_parent’ => 0, and exclude all the child comments.

    $args = array(
        'number'      => 10,
        'order'       => 'DESC',
        'status'      => 'approve',
        'meta_key'    => 'comment_parent',
        'meta_value'  => 0
    );

    $comments = get_comments( $args );
0
Sayed Taqui 2 months 0 Answers 11 views 0

Leave an answer