| @@ -8,19 +8,19 @@ | ||
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | 10 | if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
| 11 | 11 | |
| 12 | -global $wp_query; | |
| 13 | 12 | ?> |
| 14 | 13 | <div class="propertyhive-pagination"> |
| 15 | 14 | <?php |
| 16 | - if ( $wp_query->max_num_pages > 1 ) | |
| 15 | + if ( $max_num_pages > 1 ) | |
| 17 | 16 | { |
| 17 | + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- WordPress builds and escapes pagination links; preserve the PHP pagination customization filter. | |
| 18 | 18 | echo paginate_links( apply_filters( 'propertyhive_pagination_args', array( |
| 19 | 19 | 'base' => esc_url_raw( str_replace( 999999999, '%#%', get_pagenum_link( 999999999, false ) ) ), |
| 20 | 20 | 'format' => '', |
| 21 | 21 | 'current' => max( 1, get_query_var( 'paged' ) ), |
| 22 | - 'total' => $wp_query->max_num_pages, | |
| 22 | + 'total' => $max_num_pages, | |
| 23 | 23 | 'prev_text' => '←', |
| 24 | 24 | 'next_text' => '→', |
| 25 | 25 | 'type' => 'list', |
| 26 | 26 | 'end_size' => 3, |
| @@ -31,5 +31,5 @@ | ||
| 31 | 31 | { |
| 32 | 32 | echo ' '; |
| 33 | 33 | } |
| 34 | 34 | ?> |
| 35 | -</div> | |
| 35 | +</div> | |