Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




get_approved_comments [ WordPress Function ]

get_approved_comments ( $post_id )
Parameters:
  • (int) $post_id The ID of the post
Uses:
  • $wpdb
Returns:
  • (array) $comments The approved comments
Defined at:



Retrieve the approved comments for post $post_id.

Source


<?php
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));
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics