I am using the get_comments() function which works well if I give it any array of parameters except if I give the following array:

$defaults = array('ID' => $comment_id); 

$com=get_comments($defaults );

The resulting array contains all data for all comments of my website. I want to get only the data of the comment with id = $comment_id.

Thank you for your feedbacks.

1 Answer 1


I am sorry for wasting your time I think there is a simple function that can do this:

$defaults = $comment_id; 
$com= get_comment($defaults ); ?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.