Pagination fixes. Props garyc40. fixes #16357
git-svn-id: https://develop.svn.wordpress.org/trunk@17361 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
fd7c566154
commit
e131cde02f
@ -13,6 +13,7 @@ if ( !current_user_can( $tax->cap->manage_terms ) )
|
|||||||
wp_die( __( 'Cheatin’ uh?' ) );
|
wp_die( __( 'Cheatin’ uh?' ) );
|
||||||
|
|
||||||
$wp_list_table = _get_list_table('WP_Terms_List_Table');
|
$wp_list_table = _get_list_table('WP_Terms_List_Table');
|
||||||
|
$pagenum = $wp_list_table->get_pagenum();
|
||||||
|
|
||||||
$title = $tax->labels->name;
|
$title = $tax->labels->name;
|
||||||
|
|
||||||
@ -148,13 +149,23 @@ case 'editedtag':
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
||||||
if ( ! empty($_REQUEST['_wp_http_referer']) ) {
|
if ( ! empty($_REQUEST['_wp_http_referer']) ) {
|
||||||
wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) );
|
$location = remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) );
|
||||||
|
|
||||||
|
if ( ! empty( $_REQUEST['paged'] ) )
|
||||||
|
$location = add_query_arg( 'paged', (int) $_REQUEST['paged'] );
|
||||||
|
|
||||||
|
wp_redirect( $location );
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$wp_list_table->prepare_items();
|
$wp_list_table->prepare_items();
|
||||||
|
$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
|
||||||
|
|
||||||
|
if ( $pagenum > $total_pages ) {
|
||||||
|
wp_redirect( add_query_arg( 'paged', $total_pages ) );
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
wp_enqueue_script('admin-tags');
|
wp_enqueue_script('admin-tags');
|
||||||
if ( current_user_can($tax->cap->edit_terms) )
|
if ( current_user_can($tax->cap->edit_terms) )
|
||||||
|
@ -427,7 +427,11 @@ switch ( $_GET['action'] ) {
|
|||||||
|
|
||||||
wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => $userfunction ), wp_get_referer() ) );
|
wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => $userfunction ), wp_get_referer() ) );
|
||||||
} else {
|
} else {
|
||||||
wp_redirect( network_admin_url( 'users.php' ) );
|
$location = network_admin_url( 'users.php' );
|
||||||
|
|
||||||
|
if ( ! empty( $_REQUEST['paged'] ) )
|
||||||
|
$location = add_query_arg( 'paged', (int) $_REQUEST['paged'], $location );
|
||||||
|
wp_redirect( $location );
|
||||||
}
|
}
|
||||||
exit();
|
exit();
|
||||||
break;
|
break;
|
||||||
|
@ -17,8 +17,14 @@ if ( ! current_user_can( 'manage_network_users' ) )
|
|||||||
wp_die( __( 'You do not have permission to access this page.' ) );
|
wp_die( __( 'You do not have permission to access this page.' ) );
|
||||||
|
|
||||||
$wp_list_table = _get_list_table('WP_MS_Users_List_Table');
|
$wp_list_table = _get_list_table('WP_MS_Users_List_Table');
|
||||||
|
$pagenum = $wp_list_table->get_pagenum();
|
||||||
$wp_list_table->prepare_items();
|
$wp_list_table->prepare_items();
|
||||||
|
$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
|
||||||
|
|
||||||
|
if ( $pagenum > $total_pages ) {
|
||||||
|
wp_redirect( add_query_arg( 'paged', $total_pages ) );
|
||||||
|
exit;
|
||||||
|
}
|
||||||
$title = __( 'Users' );
|
$title = __( 'Users' );
|
||||||
$parent_file = 'users.php';
|
$parent_file = 'users.php';
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ if ( ! current_user_can( 'list_users' ) )
|
|||||||
wp_die( __( 'Cheatin’ uh?' ) );
|
wp_die( __( 'Cheatin’ uh?' ) );
|
||||||
|
|
||||||
$wp_list_table = _get_list_table('WP_Users_List_Table');
|
$wp_list_table = _get_list_table('WP_Users_List_Table');
|
||||||
|
$pagenum = $wp_list_table->get_pagenum();
|
||||||
$title = __('Users');
|
$title = __('Users');
|
||||||
$parent_file = 'users.php';
|
$parent_file = 'users.php';
|
||||||
|
|
||||||
@ -290,7 +290,11 @@ default:
|
|||||||
}
|
}
|
||||||
|
|
||||||
$wp_list_table->prepare_items();
|
$wp_list_table->prepare_items();
|
||||||
|
$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
|
||||||
|
if ( $pagenum > $total_pages ) {
|
||||||
|
wp_redirect( add_query_arg( 'paged', $total_pages ) );
|
||||||
|
exit;
|
||||||
|
}
|
||||||
include('./admin-header.php');
|
include('./admin-header.php');
|
||||||
|
|
||||||
$messages = array();
|
$messages = array();
|
||||||
|
@ -549,12 +549,12 @@ class WP_User_Query {
|
|||||||
$this->results = $wpdb->get_col("SELECT $this->query_fields $this->query_from $this->query_where $this->query_orderby $this->query_limit");
|
$this->results = $wpdb->get_col("SELECT $this->query_fields $this->query_from $this->query_where $this->query_orderby $this->query_limit");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !$this->results )
|
|
||||||
return;
|
|
||||||
|
|
||||||
if ( $this->query_vars['count_total'] )
|
if ( $this->query_vars['count_total'] )
|
||||||
$this->total_users = $wpdb->get_var("SELECT COUNT(*) $this->query_from $this->query_where");
|
$this->total_users = $wpdb->get_var("SELECT COUNT(*) $this->query_from $this->query_where");
|
||||||
|
|
||||||
|
if ( !$this->results )
|
||||||
|
return;
|
||||||
|
|
||||||
if ( 'all_with_meta' == $this->query_vars['fields'] ) {
|
if ( 'all_with_meta' == $this->query_vars['fields'] ) {
|
||||||
cache_users( $this->results );
|
cache_users( $this->results );
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user