Make WordPress Core


Ignore:
Timestamp:
08/19/2010 12:06:51 AM (15 years ago)
Author:
scribu
Message:

Use adminTable to refill #the-extra-comment-list. See #14637

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/default-list-tables.php

    r15508 r15509  
    19651965        $comments_per_page = apply_filters( 'comments_per_page', $comments_per_page, $comment_status );
    19661966
     1967        if ( isset( $_POST['number'] ) )
     1968            $number = (int) $_POST['number'];
     1969        else
     1970            $number = $comments_per_page + min( 8, $comments_per_page ); // Grab a few extra
     1971
    19671972        $page = $this->get_pagenum();
    19681973
     
    19731978            'search' => $search,
    19741979            'offset' => $start,
    1975             'number' => $comments_per_page + 8, // Grab a few extra
     1980            'number' => $number,
    19761981            'post_id' => $post_id,
    19771982            'plural' => $comment_type,
     
    19841989        update_comment_cache( $_comments );
    19851990
    1986         $args['count'] = true;
    1987         $args['offset'] = 0;
    1988         $args['number'] = 0;
    1989         $total_comments = get_comments( $args );
     1991        $this->items = array_slice( $_comments, 0, $comments_per_page );
     1992        $this->extra_items = array_slice( $_comments, $comments_per_page );
     1993
     1994        $total_comments = get_comments( array_merge( $args, array('count' => true, 'offset' => 0, 'number' => 0) ) );
    19901995
    19911996        $_comment_post_ids = array();
     
    19952000
    19962001        $_comment_pending_count = get_pending_comments_num( $_comment_post_ids );
    1997 
    1998         $this->items = array_slice( $_comments, 0, $comments_per_page );
    1999         $this->extra_items = array_slice( $_comments, $comments_per_page );
    20002002
    20012003        $this->set_pagination_args( array(
     
    21152117    }
    21162118
    2117     function display_rows( $items = array() ) {
     2119    function display_rows( $items = false ) {
    21182120        global $mode, $comment_status;
    21192121
    2120         if ( empty( $items ) )
     2122        if ( false === $items )
    21212123            $items = $this->items;
    21222124
Note: See TracChangeset for help on using the changeset viewer.