WordPress.org

Make WordPress Core

Changeset 17274


Ignore:
Timestamp:
01/13/11 00:03:38 (3 years ago)
Author:
markjaquith
Message:

Add "paged param is greater than total pages" redirects to a few more screens. props greuben. fixes #16187

Location:
trunk/wp-admin
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/network/sites.php

    r17144 r17274  
    1818 
    1919$wp_list_table = get_list_table('WP_MS_Sites_List_Table'); 
     20$pagenum = $wp_list_table->get_pagenum(); 
    2021 
    2122$title = __( 'Sites' ); 
     
    8889$wp_list_table->prepare_items(); 
    8990 
     91$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' ); 
     92if ( $pagenum > $total_pages && $total_pages > 0 ) { 
     93    wp_redirect( add_query_arg( 'paged', $total_pages ) ); 
     94    exit; 
     95} 
     96 
    9097require_once( '../admin-header.php' ); 
    9198?> 
  • trunk/wp-admin/network/themes.php

    r17238 r17274  
    2323 
    2424$wp_list_table = get_list_table('WP_MS_Themes_List_Table'); 
     25$pagenum = $wp_list_table->get_pagenum(); 
    2526 
    2627$action = $wp_list_table->current_action(); 
     
    170171 
    171172$wp_list_table->prepare_items(); 
     173 
     174$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' ); 
     175if ( $pagenum > $total_pages && $total_pages > 0 ) { 
     176    wp_redirect( add_query_arg( 'paged', $total_pages ) ); 
     177    exit; 
     178} 
     179 
    172180add_thickbox(); 
    173181 
  • trunk/wp-admin/plugin-install.php

    r16990 r17274  
    2222 
    2323$wp_list_table = get_list_table('WP_Plugin_Install_List_Table'); 
     24$pagenum = $wp_list_table->get_pagenum(); 
    2425$wp_list_table->prepare_items(); 
     26$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' ); 
     27if ( $pagenum > $total_pages && $total_pages > 0 ) { 
     28    wp_redirect( add_query_arg( 'paged', $total_pages ) ); 
     29    exit; 
     30} 
    2531 
    2632$title = __('Install Plugins'); 
  • trunk/wp-admin/plugins.php

    r17221 r17274  
    2121 
    2222$wp_list_table = get_list_table('WP_Plugins_List_Table'); 
     23$pagenum = $wp_list_table->get_pagenum(); 
    2324 
    2425$action = $wp_list_table->current_action(); 
     
    316317$wp_list_table->prepare_items(); 
    317318 
     319$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' ); 
     320if ( $pagenum > $total_pages && $total_pages > 0 ) { 
     321    wp_redirect( add_query_arg( 'paged', $total_pages ) ); 
     322    exit; 
     323} 
     324 
    318325wp_enqueue_script('plugin-install'); 
    319326add_thickbox(); 
  • trunk/wp-admin/theme-install.php

    r16990 r17274  
    2222 
    2323$wp_list_table = get_list_table('WP_Theme_Install_List_Table'); 
     24$pagenum = $wp_list_table->get_pagenum(); 
    2425$wp_list_table->prepare_items(); 
     26$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' ); 
     27if ( $pagenum > $total_pages && $total_pages > 0 ) { 
     28    wp_redirect( add_query_arg( 'paged', $total_pages ) ); 
     29    exit; 
     30} 
    2531 
    2632$title = __('Install Themes'); 
Note: See TracChangeset for help on using the changeset viewer.