wpseek.com
Uma área de pesquisa sobre o WordPress para devs e autores do tema
get_approved_comments › WordPress Function
Desde2.0.0
Obsoleton/a
› get_approved_comments ( $post_id, $args = array() )
| Parâmetros: (2) |
|
| Retorna: |
|
| Definido em: |
|
| Codex: | |
| Log de mudanças: |
|
Retrieves the approved comments for a post.
Funções relacionadas: get_comments, get_pending_comments_num, have_comments, get_page_of_comment, get_comment
Fonte
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 );
}