diff --git wp-admin/edit-comments.php wp-admin/edit-comments.php
index 40ef4a4..d84e2f9 100644
|
|
if ( $doaction ) { |
101 | 101 | |
102 | 102 | $wp_list_table->prepare_items(); |
103 | 103 | |
104 | | $total_pages = $wp_list_table->get_pagination_arg( 'total_pages' ); |
105 | | if ( $pagenum > $total_pages && $total_pages > 0 ) { |
106 | | wp_redirect( add_query_arg( 'paged', $total_pages ) ); |
107 | | exit; |
108 | | } |
109 | | |
110 | 104 | wp_enqueue_script('admin-comments'); |
111 | 105 | enqueue_comment_hotkeys_js(); |
112 | 106 | |
diff --git wp-admin/edit-tags.php wp-admin/edit-tags.php
index 13534de..d576b63 100644
|
|
case 'editedtag': |
148 | 148 | break; |
149 | 149 | |
150 | 150 | default: |
151 | | |
152 | 151 | if ( ! empty($_REQUEST['_wp_http_referer']) ) { |
153 | | wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) ); |
154 | | exit; |
| 152 | $location = remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ); |
| 153 | |
| 154 | if ( ! empty( $_REQUEST['paged'] ) ) |
| 155 | $location = add_query_arg( 'paged', $_REQUEST['paged'] ); |
| 156 | |
| 157 | wp_redirect( $location ); |
| 158 | exit; |
155 | 159 | } |
156 | 160 | |
157 | 161 | $wp_list_table->prepare_items(); |
diff --git wp-admin/edit.php wp-admin/edit.php
index 5c7b194..f55cb6e 100644
|
|
if ( 'post' != $post_type ) { |
142 | 142 | |
143 | 143 | $wp_list_table->prepare_items(); |
144 | 144 | |
145 | | $total_pages = $wp_list_table->get_pagination_arg( 'total_pages' ); |
146 | | if ( $pagenum > $total_pages && $total_pages > 0 ) { |
147 | | wp_redirect( add_query_arg( 'paged', $total_pages ) ); |
148 | | exit; |
149 | | } |
150 | | |
151 | 145 | wp_enqueue_script('inline-edit-post'); |
152 | 146 | |
153 | 147 | $title = $post_type_object->labels->name; |
diff --git wp-admin/includes/class-wp-list-table.php wp-admin/includes/class-wp-list-table.php
index e7ce9e5..c3b20c4 100644
|
|
class WP_List_Table { |
138 | 138 | |
139 | 139 | if ( !$args['total_pages'] && $args['per_page'] > 0 ) |
140 | 140 | $args['total_pages'] = ceil( $args['total_items'] / $args['per_page'] ); |
141 | | |
| 141 | |
| 142 | if( ! headers_sent() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) && $args['total_pages'] > 0 && $this->get_pagenum() > $args['total_pages'] ) { |
| 143 | wp_redirect( add_query_arg( 'paged', $args['total_pages'] ) ); |
| 144 | exit; |
| 145 | } |
| 146 | |
142 | 147 | $this->_pagination_args = $args; |
143 | 148 | } |
144 | 149 | |
… |
… |
class WP_List_Table { |
443 | 448 | function get_pagenum() { |
444 | 449 | $pagenum = isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 0; |
445 | 450 | |
446 | | if( isset( $this->_pagination_args['total_pages'] ) && $pagenum > $this->_pagination_args['total_pages'] ) |
447 | | $pagenum = $this->_pagination_args['total_pages']; |
448 | | |
449 | 451 | return max( 1, $pagenum ); |
450 | 452 | } |
451 | 453 | |
diff --git wp-admin/network/edit.php wp-admin/network/edit.php
index 1e06e49..9d680b4 100644
|
|
switch ( $_GET['action'] ) { |
427 | 427 | |
428 | 428 | wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => $userfunction ), wp_get_referer() ) ); |
429 | 429 | } else { |
430 | | wp_redirect( network_admin_url( 'users.php' ) ); |
| 430 | $location = network_admin_url( 'users.php' ); |
| 431 | |
| 432 | if ( ! empty( $_REQUEST['paged'] ) ) |
| 433 | $location = add_query_arg( 'paged', $_REQUEST['paged'], $location ); |
| 434 | wp_redirect( $location ); |
431 | 435 | } |
432 | 436 | exit(); |
433 | 437 | break; |
diff --git wp-admin/network/sites.php wp-admin/network/sites.php
index 8a77d63..45dd338 100644
|
|
if ( ! current_user_can( 'manage_sites' ) ) |
17 | 17 | wp_die( __( 'You do not have permission to access this page.' ) ); |
18 | 18 | |
19 | 19 | $wp_list_table = _get_list_table('WP_MS_Sites_List_Table'); |
20 | | $pagenum = $wp_list_table->get_pagenum(); |
21 | 20 | |
22 | 21 | $title = __( 'Sites' ); |
23 | 22 | $parent_file = 'sites.php'; |
… |
… |
if ( isset( $_REQUEST['updated'] ) && $_REQUEST['updated'] == 'true' && ! empty( |
88 | 87 | |
89 | 88 | $wp_list_table->prepare_items(); |
90 | 89 | |
91 | | $total_pages = $wp_list_table->get_pagination_arg( 'total_pages' ); |
92 | | if ( $pagenum > $total_pages && $total_pages > 0 ) { |
93 | | wp_redirect( add_query_arg( 'paged', $total_pages ) ); |
94 | | exit; |
95 | | } |
96 | | |
97 | 90 | require_once( '../admin-header.php' ); |
98 | 91 | ?> |
99 | 92 | |
diff --git wp-admin/network/themes.php wp-admin/network/themes.php
index b802f74..f8545d3 100644
|
|
if ( !current_user_can('manage_network_themes') ) |
22 | 22 | wp_die( __( 'You do not have sufficient permissions to manage network themes.' ) ); |
23 | 23 | |
24 | 24 | $wp_list_table = _get_list_table('WP_MS_Themes_List_Table'); |
25 | | $pagenum = $wp_list_table->get_pagenum(); |
26 | 25 | |
27 | 26 | $action = $wp_list_table->current_action(); |
28 | 27 | |
… |
… |
if ( $action ) { |
171 | 170 | |
172 | 171 | $wp_list_table->prepare_items(); |
173 | 172 | |
174 | | $total_pages = $wp_list_table->get_pagination_arg( 'total_pages' ); |
175 | | if ( $pagenum > $total_pages && $total_pages > 0 ) { |
176 | | wp_redirect( add_query_arg( 'paged', $total_pages ) ); |
177 | | exit; |
178 | | } |
179 | | |
180 | 173 | add_thickbox(); |
181 | 174 | |
182 | 175 | add_screen_option( 'per_page', array('label' => _x( 'Themes', 'themes per page (screen options)' )) ); |
diff --git wp-admin/network/users.php wp-admin/network/users.php
index eb59670..7e1f63c 100644
|
|
if ( ! current_user_can( 'manage_network_users' ) ) |
17 | 17 | wp_die( __( 'You do not have permission to access this page.' ) ); |
18 | 18 | |
19 | 19 | $wp_list_table = _get_list_table('WP_MS_Users_List_Table'); |
| 20 | |
20 | 21 | $wp_list_table->prepare_items(); |
21 | 22 | |
22 | 23 | $title = __( 'Users' ); |
diff --git wp-admin/plugin-install.php wp-admin/plugin-install.php
index 971ab68..0812750 100644
|
|
if ( is_multisite() && ! is_network_admin() ) { |
21 | 21 | } |
22 | 22 | |
23 | 23 | $wp_list_table = _get_list_table('WP_Plugin_Install_List_Table'); |
24 | | $pagenum = $wp_list_table->get_pagenum(); |
| 24 | |
25 | 25 | $wp_list_table->prepare_items(); |
26 | | $total_pages = $wp_list_table->get_pagination_arg( 'total_pages' ); |
27 | | if ( $pagenum > $total_pages && $total_pages > 0 ) { |
28 | | wp_redirect( add_query_arg( 'paged', $total_pages ) ); |
29 | | exit; |
30 | | } |
31 | 26 | |
32 | 27 | $title = __('Install Plugins'); |
33 | 28 | $parent_file = 'plugins.php'; |
diff --git wp-admin/plugins.php wp-admin/plugins.php
index 0c36bbd..f423426 100644
|
|
if ( !current_user_can('activate_plugins') ) |
20 | 20 | wp_die( __( 'You do not have sufficient permissions to manage plugins for this site.' ) ); |
21 | 21 | |
22 | 22 | $wp_list_table = _get_list_table('WP_Plugins_List_Table'); |
23 | | $pagenum = $wp_list_table->get_pagenum(); |
24 | 23 | |
25 | 24 | $action = $wp_list_table->current_action(); |
26 | 25 | |
… |
… |
if ( $action ) { |
316 | 315 | |
317 | 316 | $wp_list_table->prepare_items(); |
318 | 317 | |
319 | | $total_pages = $wp_list_table->get_pagination_arg( 'total_pages' ); |
320 | | if ( $pagenum > $total_pages && $total_pages > 0 ) { |
321 | | wp_redirect( add_query_arg( 'paged', $total_pages ) ); |
322 | | exit; |
323 | | } |
324 | | |
325 | 318 | wp_enqueue_script('plugin-install'); |
326 | 319 | add_thickbox(); |
327 | 320 | |
diff --git wp-admin/theme-install.php wp-admin/theme-install.php
index 263d9a9..d92b6ae 100644
|
|
if ( is_multisite() && ! is_network_admin() ) { |
21 | 21 | } |
22 | 22 | |
23 | 23 | $wp_list_table = _get_list_table('WP_Theme_Install_List_Table'); |
24 | | $pagenum = $wp_list_table->get_pagenum(); |
| 24 | |
25 | 25 | $wp_list_table->prepare_items(); |
26 | | $total_pages = $wp_list_table->get_pagination_arg( 'total_pages' ); |
27 | | if ( $pagenum > $total_pages && $total_pages > 0 ) { |
28 | | wp_redirect( add_query_arg( 'paged', $total_pages ) ); |
29 | | exit; |
30 | | } |
31 | 26 | |
32 | 27 | $title = __('Install Themes'); |
33 | 28 | $parent_file = 'themes.php'; |
diff --git wp-admin/upload.php wp-admin/upload.php
index 6a1d9b4..2ca11ba 100644
|
|
if ( !current_user_can('upload_files') ) |
13 | 13 | wp_die( __( 'You do not have permission to upload files.' ) ); |
14 | 14 | |
15 | 15 | $wp_list_table = _get_list_table('WP_Media_List_Table'); |
16 | | $pagenum = $wp_list_table->get_pagenum(); |
17 | 16 | |
18 | 17 | // Handle bulk actions |
19 | 18 | $doaction = $wp_list_table->current_action(); |
… |
… |
if ( $doaction ) { |
130 | 129 | |
131 | 130 | $wp_list_table->prepare_items(); |
132 | 131 | |
133 | | $total_pages = $wp_list_table->get_pagination_arg( 'total_pages' ); |
134 | | if ( $pagenum > $total_pages && $total_pages > 0 ) { |
135 | | wp_redirect( add_query_arg( 'paged', $total_pages ) ); |
136 | | exit; |
137 | | } |
138 | | |
139 | 132 | $title = __('Media Library'); |
140 | 133 | $parent_file = 'upload.php'; |
141 | 134 | |
diff --git wp-includes/user.php wp-includes/user.php
index e39d19e..2a1a101 100644
|
|
class WP_User_Query { |
542 | 542 | */ |
543 | 543 | function query() { |
544 | 544 | global $wpdb; |
545 | | |
| 545 | |
546 | 546 | if ( is_array( $this->query_vars['fields'] ) || 'all' == $this->query_vars['fields'] ) { |
547 | 547 | $this->results = $wpdb->get_results("SELECT $this->query_fields $this->query_from $this->query_where $this->query_orderby $this->query_limit"); |
548 | 548 | } else { |
549 | 549 | $this->results = $wpdb->get_col("SELECT $this->query_fields $this->query_from $this->query_where $this->query_orderby $this->query_limit"); |
550 | 550 | } |
| 551 | |
| 552 | if ( $this->query_vars['count_total'] ) |
| 553 | $this->total_users = $wpdb->get_var("SELECT COUNT(*) $this->query_from $this->query_where"); |
551 | 554 | |
552 | 555 | if ( !$this->results ) |
553 | 556 | return; |
554 | 557 | |
555 | | if ( $this->query_vars['count_total'] ) |
556 | | $this->total_users = $wpdb->get_var("SELECT COUNT(*) $this->query_from $this->query_where"); |
557 | | |
558 | 558 | if ( 'all_with_meta' == $this->query_vars['fields'] ) { |
559 | 559 | cache_users( $this->results ); |
560 | 560 | |