separate_comments [ WordPress Function ]
separate_comments ( $comments )
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Separates an array of comments into an array keyed by comment_type.
Source
<?php
function &separate_comments(&$comments) {
$comments_by_type = array('comment' => array(), 'trackback' => array(), 'pingback' => array(), 'pings' => array());
$count = count($comments);
for ( $i = 0; $i < $count; $i++ ) {
$type = $comments[$i]->comment_type;
if ( empty($type) )
$type = 'comment';
$comments_by_type[$type][] = &$comments[$i];
if ( 'trackback' == $type || 'pingback' == $type )
$comments_by_type['pings'][] = &$comments[$i];
}
return $comments_by_type;
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- Function Reference/comments template « WordPress Codex
<?php comments_template( $file, $separate_comments ); ?> ... $ separate_comments: (boolean) (optional) Whether to separate the comments by comment type.
codex.wordpress.org - PHPXRef 0.7 : WordPress : Function Reference: separate_comments()
Function and Method Cross Reference. separate_comments(). Defined at: /wp- includes/comment.php -> line 713. Referenced 3 times: ...
phpxref.ftwr.co.uk - How to Separate Comments and Trackbacks [Wordpress Tips]
Most wordpress themes out there (by default) combine both comments and trackbacks / pingbacks together and display under the same list. But why bother.
www.hongkiat.com - separate_comments (WordPress Function) - WPSeek.com
WordPress lookup for separate_comments, a WordPress Function. wpseek.com is a WordPress-centric search tool for developers and theme authors.
wpseek.com