mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
Add "paged param is greater than total pages" redirects to a few more screens. props greuben. fixes #16187
git-svn-id: http://svn.automattic.com/wordpress/trunk@17274 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
5787bf3e0e
commit
8e2683d127
@ -17,6 +17,7 @@ if ( ! current_user_can( 'manage_sites' ) )
|
||||
wp_die( __( 'You do not have permission to access this page.' ) );
|
||||
|
||||
$wp_list_table = get_list_table('WP_MS_Sites_List_Table');
|
||||
$pagenum = $wp_list_table->get_pagenum();
|
||||
|
||||
$title = __( 'Sites' );
|
||||
$parent_file = 'sites.php';
|
||||
@ -87,6 +88,12 @@ if ( isset( $_REQUEST['updated'] ) && $_REQUEST['updated'] == 'true' && ! empty(
|
||||
|
||||
$wp_list_table->prepare_items();
|
||||
|
||||
$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
|
||||
if ( $pagenum > $total_pages && $total_pages > 0 ) {
|
||||
wp_redirect( add_query_arg( 'paged', $total_pages ) );
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once( '../admin-header.php' );
|
||||
?>
|
||||
|
||||
|
@ -22,6 +22,7 @@ if ( !current_user_can('manage_network_themes') )
|
||||
wp_die( __( 'You do not have sufficient permissions to manage network themes.' ) );
|
||||
|
||||
$wp_list_table = get_list_table('WP_MS_Themes_List_Table');
|
||||
$pagenum = $wp_list_table->get_pagenum();
|
||||
|
||||
$action = $wp_list_table->current_action();
|
||||
|
||||
@ -169,6 +170,13 @@ if ( $action ) {
|
||||
}
|
||||
|
||||
$wp_list_table->prepare_items();
|
||||
|
||||
$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
|
||||
if ( $pagenum > $total_pages && $total_pages > 0 ) {
|
||||
wp_redirect( add_query_arg( 'paged', $total_pages ) );
|
||||
exit;
|
||||
}
|
||||
|
||||
add_thickbox();
|
||||
|
||||
add_screen_option( 'per_page', array('label' => _x( 'Themes', 'themes per page (screen options)' )) );
|
||||
|
@ -21,7 +21,13 @@ if ( is_multisite() && ! is_network_admin() ) {
|
||||
}
|
||||
|
||||
$wp_list_table = get_list_table('WP_Plugin_Install_List_Table');
|
||||
$pagenum = $wp_list_table->get_pagenum();
|
||||
$wp_list_table->prepare_items();
|
||||
$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
|
||||
if ( $pagenum > $total_pages && $total_pages > 0 ) {
|
||||
wp_redirect( add_query_arg( 'paged', $total_pages ) );
|
||||
exit;
|
||||
}
|
||||
|
||||
$title = __('Install Plugins');
|
||||
$parent_file = 'plugins.php';
|
||||
|
@ -20,6 +20,7 @@ if ( !current_user_can('activate_plugins') )
|
||||
wp_die( __( 'You do not have sufficient permissions to manage plugins for this site.' ) );
|
||||
|
||||
$wp_list_table = get_list_table('WP_Plugins_List_Table');
|
||||
$pagenum = $wp_list_table->get_pagenum();
|
||||
|
||||
$action = $wp_list_table->current_action();
|
||||
|
||||
@ -315,6 +316,12 @@ if ( $action ) {
|
||||
|
||||
$wp_list_table->prepare_items();
|
||||
|
||||
$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
|
||||
if ( $pagenum > $total_pages && $total_pages > 0 ) {
|
||||
wp_redirect( add_query_arg( 'paged', $total_pages ) );
|
||||
exit;
|
||||
}
|
||||
|
||||
wp_enqueue_script('plugin-install');
|
||||
add_thickbox();
|
||||
|
||||
|
@ -21,7 +21,13 @@ if ( is_multisite() && ! is_network_admin() ) {
|
||||
}
|
||||
|
||||
$wp_list_table = get_list_table('WP_Theme_Install_List_Table');
|
||||
$pagenum = $wp_list_table->get_pagenum();
|
||||
$wp_list_table->prepare_items();
|
||||
$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
|
||||
if ( $pagenum > $total_pages && $total_pages > 0 ) {
|
||||
wp_redirect( add_query_arg( 'paged', $total_pages ) );
|
||||
exit;
|
||||
}
|
||||
|
||||
$title = __('Install Themes');
|
||||
$parent_file = 'themes.php';
|
||||
|
Loading…
Reference in New Issue
Block a user