Fix pagination by preventing old query args from being re-added to the link
Fixes #7164
This commit is contained in:
parent
0b393b7e82
commit
7f2a6b5e41
|
@ -104,12 +104,14 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
<div class="pagination">
|
||||
<?php
|
||||
echo str_replace( 'page-numbers', 'page-numbers button', paginate_links( array(
|
||||
'base' => add_query_arg( 'p', '%#%' ),
|
||||
'base' => esc_url_raw( add_query_arg( 'p', '%#%', remove_query_arg( 'p' ) ) ),
|
||||
'format' => '',
|
||||
'add_args' => '',
|
||||
'type' => 'plain',
|
||||
'prev_text' => '«',
|
||||
'next_text' => '»',
|
||||
'total' => ceil( absint( $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(tax_rate_id) FROM {$wpdb->prefix}woocommerce_tax_rates WHERE tax_rate_class = %s;", sanitize_title( $current_class ) ) ) ) / $limit ),
|
||||
'current' => $page
|
||||
'current' => $page,
|
||||
'total' => ceil( absint( $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(tax_rate_id) FROM {$wpdb->prefix}woocommerce_tax_rates WHERE tax_rate_class = %s;", sanitize_title( $current_class ) ) ) ) / $limit )
|
||||
) ) );
|
||||
?>
|
||||
</div>
|
||||
|
|
|
@ -22,6 +22,7 @@ if ( $wp_query->max_num_pages <= 1 ) {
|
|||
echo paginate_links( apply_filters( 'woocommerce_pagination_args', array(
|
||||
'base' => esc_url_raw( str_replace( 999999999, '%#%', remove_query_arg( 'add-to-cart', get_pagenum_link( 999999999, false ) ) ) ),
|
||||
'format' => '',
|
||||
'add_args' => '',
|
||||
'current' => max( 1, get_query_var( 'paged' ) ),
|
||||
'total' => $wp_query->max_num_pages,
|
||||
'prev_text' => '←',
|
||||
|
|
Loading…
Reference in New Issue