Languages: English • Italiano • (Add your language)
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($postID); foreach($comment_array as $comment){ echo $comment->comment_ID." => ".$comment->comment_post_ID."\n"; } ?>
Since: 2.0.0
current_user_can_for_blog() is located in wp-includes/capabilities.php