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

Props swissspidy.
See #38194.

git-svn-id: https://develop.svn.wordpress.org/trunk@38752 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dominik Schilling (ocean90) 2016-10-07 20:05:45 +00:00
parent bb8d792d37
commit cf14d8a2a2

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.