diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 108a40331d..96d3389f9c 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -474,8 +474,6 @@ function get_pagenum_link($pagenum = 1) { $result = $base . $request; } } else { - $request = preg_replace( '|/?page/(.+)/?$|', '', $request); - $qs_regex = '|\?.*?$|'; preg_match( $qs_regex, $request, $qs_match ); @@ -486,6 +484,8 @@ function get_pagenum_link($pagenum = 1) { $query_string = ''; } + $request = preg_replace( '|/?page/(.+)/?$|', '', $request); + $base = trailingslashit( get_bloginfo( 'url' ) ); if ( $wp_rewrite->using_index_permalinks() && $pagenum > 1 ) {