Codex tools: Log in / create account
Contents |
Takes post ID and returns an array of objects that represent comments that have been submitted and approved.
<?php $comment_array = get_approved_comments($post_id); ?>
In this example we will output a simple list of comment IDs and corresponding post IDs.
<?php
$postID = 1;
$comment_array = get_approved_comments(1);
foreach($comment_array as $comment){
echo $comment->comment_ID." => ".$comment->comment_post_ID."\n";
}
?>
This article is marked as in need of editing. You can help Codex by editing it.