Make WordPress Core


Ignore:
Timestamp:
09/26/2015 02:24:17 AM (9 years ago)
Author:
wonderboymusic
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/comment-template.php

    r34561 r34569  
    13081308    $comments_flat = array();
    13091309    foreach ( $_comments as $_comment ) {
    1310         $comments_flat = array_merge( $comments_flat, array( $_comment ), $_comment->get_children( 'flat' ) );
     1310        $comments_flat = array_merge( $comments_flat, array( $_comment ), $_comment->get_children( array(
     1311            'format' => 'flat',
     1312            'status' => $comment_args['status'],
     1313            'orderby' => $comment_args['orderby']
     1314        ) ) );
    13111315    }
    13121316
Note: See TracChangeset for help on using the changeset viewer.