WordPress.org

Make WordPress Core

Changeset 9558


Ignore:
Timestamp:
11/06/2008 10:52:05 PM (10 years ago)
Author:
ryan
Message:

Fix page counting

File:
1 edited

Legend:

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

    r9557 r9558  
    177177    $per_page = 20;
    178178
    179 $num_pages = ceil(count($posts) / $per_page);
     179$num_pages = ceil($wp_query->post_count / $per_page);
    180180$page_links = paginate_links( array(
    181181    'base' => add_query_arg( 'pagenum', '%#%' ),
     
    189189if ( $page_links ) : ?>
    190190<div class="tablenav-pages"><?php $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s-%s of %s' ) . '</span>' . __( '%s' ),
    191     number_format_i18n( ( $_GET['paged'] - 1 ) * $wp_query->query_vars['posts_per_page'] + 1 ),
    192     number_format_i18n( min( $_GET['paged'] * $wp_query->query_vars['posts_per_page'], $wp_query->found_posts ) ),
    193     number_format_i18n( $wp_query->found_posts ),
     191    number_format_i18n( ( $pagenum - 1 ) * $per_page + 1 ),
     192    number_format_i18n( min( $pagenum * $per_page, $wp_query->post_count ) ),
     193    number_format_i18n( $wp_query->post_count ),
    194194    $page_links
    195195); echo $page_links_text; ?></div>
Note: See TracChangeset for help on using the changeset viewer.