WordPress.org

Make WordPress Core

Changeset 16465


Ignore:
Timestamp:
11/18/2010 05:00:24 PM (8 years ago)
Author:
scribu
Message:

Always use 'paged' in list tables. See #14579

Location:
trunk/wp-admin/includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/class-wp-list-table.php

    r16442 r16465  
    129129    function set_pagination_args( $args ) {
    130130        $args = wp_parse_args( $args, array(
    131             'query_var' => 'paged',
    132131            'total_items' => 0,
    133132            'total_pages' => 0,
     
    410409     * @return int
    411410     */
    412     function get_pagenum( $query_var = 'paged' ) {
    413         $pagenum = isset( $_REQUEST[$query_var] ) ? absint( $_REQUEST[$query_var] ) : 0;
     411    function get_pagenum() {
     412        $pagenum = isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 0;
    414413
    415414        return max( 1, $pagenum );
     
    454453        $output = '<span class="displaying-num">' . sprintf( _n( '1 item', '%s items', $total_items ), number_format_i18n( $total_items ) ) . '</span>';
    455454
    456         $current = $this->get_pagenum( $query_var );
     455        $current = $this->get_pagenum();
    457456
    458457        $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
     
    463462            'first-page',
    464463            esc_attr__( 'Go to the first page' ),
    465             esc_url( remove_query_arg( $query_var, $current_url ) ),
     464            esc_url( remove_query_arg( 'paged', $current_url ) ),
    466465            '&laquo;&laquo;'
    467466        );
     
    470469            'prev-page',
    471470            esc_attr__( 'Go to the previous page' ),
    472             esc_url( add_query_arg( $query_var, max( 1, $current-1 ), $current_url ) ),
     471            esc_url( add_query_arg( 'paged', max( 1, $current-1 ), $current_url ) ),
    473472            '&laquo;'
    474473        );
     
    476475        $html_current_page = sprintf( "<input class='current-page' title='%s' type='text' name='%s' value='%s' size='%d' />",
    477476            esc_attr__( 'Current page' ),
    478             esc_attr( $query_var ),
     477            esc_attr( 'paged' ),
    479478            number_format_i18n( $current ),
    480479            strlen( $total_pages )
     
    486485            'next-page',
    487486            esc_attr__( 'Go to the next page' ),
    488             esc_url( add_query_arg( $query_var, min( $total_pages, $current+1 ), $current_url ) ),
     487            esc_url( add_query_arg( 'paged', min( $total_pages, $current+1 ), $current_url ) ),
    489488            '&raquo;'
    490489        );
     
    493492            'last-page',
    494493            esc_attr__( 'Go to the last page' ),
    495             esc_url( add_query_arg( $query_var, $total_pages, $current_url ) ),
     494            esc_url( add_query_arg( 'paged', $total_pages, $current_url ) ),
    496495            '&raquo;&raquo;'
    497496        );
  • trunk/wp-admin/includes/class-wp-themes-list-table.php

    r16182 r16465  
    5656
    5757        $this->set_pagination_args( array(
    58             'query_var' => 'pagenum',
    5958            'total_items' => count( $themes ),
    6059            'per_page' => $per_page,
Note: See TracChangeset for help on using the changeset viewer.