Make WordPress Core


Ignore:
Timestamp:
01/25/2011 07:20:20 PM (16 years ago)
Author:
ryan
Message:

Pagination fixes. Props garyc40. fixes #16357

File:
1 edited

Legend:

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

    r17322 r17361  
    1414
    1515$wp_list_table = _get_list_table('WP_Terms_List_Table');
     16$pagenum = $wp_list_table->get_pagenum();
    1617
    1718$title = $tax->labels->name;
     
    149150
    150151default:
    151 
    152152if ( ! empty($_REQUEST['_wp_http_referer']) ) {
    153          wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) );
    154          exit;
     153        $location = remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) );
     154
     155        if ( ! empty( $_REQUEST['paged'] ) )
     156                $location = add_query_arg( 'paged', (int) $_REQUEST['paged'] );
     157       
     158        wp_redirect( $location );
     159        exit;
    155160}
    156161
    157162$wp_list_table->prepare_items();
     163$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
     164
     165if ( $pagenum > $total_pages ) {
     166        wp_redirect( add_query_arg( 'paged', $total_pages ) );
     167        exit;
     168}
    158169
    159170wp_enqueue_script('admin-tags');
Note: See TracChangeset for help on using the changeset viewer.