I think that a good way to get what you are trying to do is to use comment__not_in
argument of get_comments()
function. Send the IDs of the comments currently being displayed in the Ajax request and use them in the comment__not_in
argument. For example, you could send those IDs as comment__not_in[]
query var (array format):
$comment_not_in = $_REQUEST['comment__not_in'];
$comments = get_comments(
array(
'post_id' => $_REQUEST['post_id'],
'status' => 'approve',
'order' => 'ASC',
'comment__not_in' => $comment_not_in,
'number' => 1000
)
);
Also, I recommend to sanitize the data. As IDs are expected to be integer numbers we can do something like this:
$comment_not_in = array_map( 'intval', $_REQUEST['comment__not_in'] );
$comments = get_comments(
array(
'post_id' => (int) $_REQUEST['post_id'],
'status' => 'approve',
'order' => 'ASC',
'comment__not_in' => $comment_not_in,
'number' => 1000
)
);