get_approved_comments

Definition:
function get_approved_comments($post_id) {}

Retrieve the approved comments for post $post_id.

Parameters

  • 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));

}

1142

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:

WordPress.com Logo

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

Facebook photo

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

Connecting to %s

%d bloggers like this: