WordPress.org

Make WordPress Core

Changeset 7859


Ignore:
Timestamp:
04/30/2008 08:05:25 PM (10 years ago)
Author:
ryan
Message:

Add comments_per_page filter

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-comments.php

    r7855 r7859  
    132132<?php
    133133
     134$comments_per_page = apply_filters('comments_per_page', 20, $comment_status);
     135
    134136if ( isset( $_GET['apage'] ) )
    135137    $page = abs( (int) $_GET['apage'] );
     
    137139    $page = 1;
    138140
    139 $start = $offset = ( $page - 1 ) * 20;
    140 
    141 list($_comments, $total) = _wp_get_comment_list( $comment_status, $search_dirty, $start, 25 ); // Grab a few extra
    142 
    143 $comments = array_slice($_comments, 0, 20);
    144 $extra_comments = array_slice($_comments, 20);
     141$start = $offset = ( $page - 1 ) * $comments_per_page;
     142
     143list($_comments, $total) = _wp_get_comment_list( $comment_status, $search_dirty, $start, $comments_per_page + 5 ); // Grab a few extra
     144
     145$comments = array_slice($_comments, 0, $comments_per_page);
     146$extra_comments = array_slice($_comments, $comments_per_page);
    145147
    146148$page_links = paginate_links( array(
    147149    'base' => add_query_arg( 'apage', '%#%' ),
    148150    'format' => '',
    149     'total' => ceil($total / 20),
     151    'total' => ceil($total / $comments_per_page),
    150152    'current' => $page
    151153));
Note: See TracChangeset for help on using the changeset viewer.