Taxonomy: Remove `paged` argument from referer and add it only if current page is greater than 1.

Props swissspidy.
See #38194.
Built from https://develop.svn.wordpress.org/trunk@38752


git-svn-id: http://core.svn.wordpress.org/trunk@38695 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling 2016-10-07 20:06:28 +00:00
parent a8802232ec
commit 32516036db
2 changed files with 5 additions and 3 deletions

View File

@ -64,7 +64,7 @@ $referer = wp_get_referer();
if ( ! $referer ) { // For POST requests.
$referer = wp_unslash( $_SERVER['REQUEST_URI'] );
}
$referer = remove_query_arg( array( '_wp_http_referer', '_wpnonce', 'error', 'message' ), $referer );
$referer = remove_query_arg( array( '_wp_http_referer', '_wpnonce', 'error', 'message', 'paged' ), $referer );
switch ( $wp_list_table->current_action() ) {
@ -195,7 +195,9 @@ if ( ! $location && ! empty( $_REQUEST['_wp_http_referer'] ) ) {
}
if ( $location ) {
$location = add_query_arg( 'paged', $pagenum, $location ); // $pagenum takes care of $total_pages.
if ( $pagenum > 1 ) {
$location = add_query_arg( 'paged', $pagenum, $location ); // $pagenum takes care of $total_pages.
}
/**
* Filters the taxonomy redirect destination URL.

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.7-alpha-38751';
$wp_version = '4.7-alpha-38752';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.