wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
get_approved_comments › WordPress Function
Seit2.0.0
Veraltetn/v
› get_approved_comments ( $post_id, $args = array() )
| Parameter: (2) |
|
| Gibt zurück: |
|
| Definiert in: |
|
| Codex: | |
| Changelog: |
|
Retrieves the approved comments for a post.
Ähnliche Funktionen: get_comments, get_pending_comments_num, have_comments, get_page_of_comment, get_comment
Quellcode
function get_approved_comments( $post_id, $args = array() ) {
if ( ! $post_id ) {
return array();
}
$defaults = array(
'status' => 1,
'post_id' => $post_id,
'order' => 'ASC',
);
$parsed_args = wp_parse_args( $args, $defaults );
$query = new WP_Comment_Query();
return $query->query( $parsed_args );
}