PluginProbe
Filter Everything — WordPress & WooCommerce Filters / trunk
Filter Everything — WordPress & WooCommerce Filters vtrunk
1.9.6 1.9.5 1.9.4 1.9.3 1.9.2.2 1.9.2.1 trunk 1.2.1 1.2.3 1.2.4 1.2.5 1.3.0 1.3.1 1.3.2 1.4.1 1.4.4 1.4.5 1.4.8 1.4.9 1.5.0 1.5.1 1.6.0 1.6.1 1.6.2 1.6.3 All 51 releases
filter-everything / views / frontend / apply-button.php

apply-button.php in Filter Everything — WordPress & WooCommerce Filters trunk, at views/frontend/apply-button.php

48 lines 2.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * The Template for displaying Apply button.
4 *
5 * This template can be overridden by copying it to yourtheme/filters/apply-button.php.
6 *
7 * @see https://filtereverything.pro/resources/templates-overriding/
8 */
9
10 if ( ! defined('ABSPATH') ) {
11 exit;
12 }
13
14 $set_id = isset( $set['ID'] ) ? esc_html( $set['ID'] ) : 0;
15 $horizontal_view = false;
16 if(!empty($set['horizontal_view']['value']) && $set['horizontal_view']['value'] === 'yes'){
17 $horizontal_view = true;
18 }
19 $apply_button_page_type = false;
20 if(!empty($set['apply_button_page_type']['value']) && $set['apply_button_page_type']['value'] !== 'no_page___no_page'){
21 $apply_button_page_type = true;
22 }
23 // Clean permalink of the Apply button location, WITHOUT the current filter
24 // segments. The JS appends the freshly selected segments to this base — using
25 // $apply_url for that duplicated the segments already present in the page URL.
26 $apply_base_url = isset( $apply_base_url ) ? $apply_base_url : '';
27 $term_count_hidden_class = '';
28 if(empty($is_filter_request) && !$is_filter_request){
29 $term_count_hidden_class .= ' wpc-hidden-term-count';
30 }
31 if (empty($found_posts)){
32 $found_posts = 0;
33 }
34 ?>
35 <div class="wpc-filters-section wpc-filters-section-<?php echo $set_id; ?> wpc-filter-layout-submit-button <?php echo $horizontal_view ? '' : 'wpc-pc-sticky-buttons'; ?>">
36 <div class="wpc-sticky-buttons">
37 <a class="wpc-filters-submit-button" href="<?php echo esc_url( $apply_url ); ?>" data-wpc-apply-url="<?php echo esc_url( $apply_url ); ?>" data-wpc-apply-base-url="<?php echo esc_url( $apply_base_url ); ?>" data-apply-button-page="<?php echo esc_attr( $apply_button_page_type ) ?>">
38 <?php
39 $button_text = isset( $set['apply_button_text']['value'] ) ? esc_html( $set['apply_button_text']['value'] ) : esc_html__('Show', 'filter-everything');
40 echo $button_text . "<span class='wpc-pc-apply-button " . $term_count_hidden_class . "'>(" . esc_html($found_posts) . ")</span>";
41 ?></a>
42 <a class="wpc-filters-reset-button wpc-filters-reset-button-<?php echo $set_id; ?>" href="<?php echo esc_attr( $reset_url ) ?>" data-wpc-apply-reset-url="<?php echo esc_url( $reset_url ); ?>"><?php
43 $reset_button_text = isset( $set['reset_button_text']['value'] ) ? esc_html( $set['reset_button_text']['value'] ) : esc_html__('Reset', 'filter-everything');
44 echo $reset_button_text;
45 ?></a>
46 </div>
47 </div>
48