function get_approved_comments($post_id) {}

Retrieve the approved comments for post $post_id.


  • int $post_id: The ID of the post

Return values

returns:The approved comments

Source code

function get_approved_comments($post_id) {

	global $wpdb;

	return $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved = '1' ORDER BY comment_date", $post_id));



No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: