mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-14 09:34:41 +00:00
Comments: in WP_Comment::get_children(), accept an array so that the values for format, status, hierarchical, and orderby can be passed, instead of just format. The defaults for get_comments() include status = 'all' and orderby = '' - which is no bueno.
For threaded comments, we need comments to be retrieved within bounds, so logged-out users don't see unmoderated comments on the front end, etc. Updates unit tests. See #8071. git-svn-id: https://develop.svn.wordpress.org/trunk@34569 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1307,7 +1307,11 @@ function comments_template( $file = '/comments.php', $separate_comments = false
|
||||
// Trees must be flattened before they're passed to the walker.
|
||||
$comments_flat = array();
|
||||
foreach ( $_comments as $_comment ) {
|
||||
$comments_flat = array_merge( $comments_flat, array( $_comment ), $_comment->get_children( 'flat' ) );
|
||||
$comments_flat = array_merge( $comments_flat, array( $_comment ), $_comment->get_children( array(
|
||||
'format' => 'flat',
|
||||
'status' => $comment_args['status'],
|
||||
'orderby' => $comment_args['orderby']
|
||||
) ) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user