From d58cb434ad88fab16ec6532aa294f38e7d018b6b Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 6 Nov 2008 22:52:05 +0000 Subject: [PATCH] Fix page counting git-svn-id: http://svn.automattic.com/wordpress/trunk@9558 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/edit-pages.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-admin/edit-pages.php b/wp-admin/edit-pages.php index 1851c68a8f..6402345804 100644 --- a/wp-admin/edit-pages.php +++ b/wp-admin/edit-pages.php @@ -176,7 +176,7 @@ if ( empty($pagenum) ) if( ! isset( $per_page ) || $per_page < 0 ) $per_page = 20; -$num_pages = ceil(count($posts) / $per_page); +$num_pages = ceil($wp_query->post_count / $per_page); $page_links = paginate_links( array( 'base' => add_query_arg( 'pagenum', '%#%' ), 'format' => '', @@ -188,9 +188,9 @@ $page_links = paginate_links( array( if ( $page_links ) : ?>
' . __( 'Displaying %s-%s of %s' ) . '' . __( '%s' ), - number_format_i18n( ( $_GET['paged'] - 1 ) * $wp_query->query_vars['posts_per_page'] + 1 ), - number_format_i18n( min( $_GET['paged'] * $wp_query->query_vars['posts_per_page'], $wp_query->found_posts ) ), - number_format_i18n( $wp_query->found_posts ), + number_format_i18n( ( $pagenum - 1 ) * $per_page + 1 ), + number_format_i18n( min( $pagenum * $per_page, $wp_query->post_count ) ), + number_format_i18n( $wp_query->post_count ), $page_links ); echo $page_links_text; ?>