| @@ -1,22 +1,34 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | 3 | * The Template for displaying Filters opening/closing button. |
| 4 | 4 | * |
| 5 | - * This template can be overridden by copying it to yourtheme/filter/filters-button.php. | |
| 5 | + * This template can be overridden by copying it to yourtheme/filters/filters-button.php. | |
| 6 | 6 | * |
| 7 | 7 | * $wpc_found_posts - int|NULL, found posts number |
| 8 | 8 | * |
| 9 | + * $button_error - array, errors | |
| 10 | + * | |
| 9 | 11 | * @see https://filtereverything.pro/resources/templates-overriding/ |
| 10 | 12 | */ |
| 11 | 13 | |
| 12 | -if ( ! defined('WPINC') ) { | |
| 13 | - wp_die(); | |
| 14 | +if ( ! defined('ABSPATH') ) { | |
| 15 | + exit; | |
| 14 | 16 | } |
| 15 | 17 | |
| 18 | +$error = ''; | |
| 19 | +if (!empty($button_error)) { | |
| 20 | + if (!empty($button_error['filter_set_error'])) { | |
| 21 | + $error .= ' data-wpc-button-filter-set-error="' . esc_attr($button_error['filter_set_error']) . '" '; | |
| 22 | + } | |
| 23 | + if (!empty($button_error['filter_widget_error'])) { | |
| 24 | + $error .= ' data-wpc-button-widget-error="' . esc_attr($button_error['filter_widget_error']) . '" '; | |
| 25 | + } | |
| 26 | +} | |
| 27 | + | |
| 16 | 28 | ?> |
| 17 | -<div class="wpc-filters-open-button-container wpc-open-button-<?php echo esc_attr( $set_id ); ?>"> | |
| 18 | - <a class="<?php echo esc_attr( $class ); ?>" href="javascript:void(0);" data-wid="<?php echo esc_attr( $set_id ); ?>"><span class="wpc-button-inner"><?php | |
| 29 | +<div class="wpc-filters-open-button-container wpc-open-button-<?php echo esc_attr( $set_id ); ?> <?php echo esc_attr( $wrap_class ); ?>"> | |
| 30 | + <a class="<?php echo esc_attr( $class ); ?>" href="javascript:void(0);" data-wid="<?php echo esc_attr( $set_id ); ?>"<?php echo $error; ?>><span class="wpc-button-inner"><?php | |
| 19 | 31 | // Button icon |
| 20 | 32 | flrt_get_icon_html(); |
| 21 | 33 | |
| 22 | 34 | ?><span class="wpc-filters-button-text"><?php |
| @@ -21,9 +33,9 @@ | ||
| 21 | 33 | |
| 22 | 34 | ?><span class="wpc-filters-button-text"><?php |
| 23 | 35 | |
| 24 | 36 | if( $wpc_found_posts !== NULL ){ |
| 25 | - esc_html_e( sprintf( __('Filters %s', 'filter-everything'), '('.$wpc_found_posts.')' ) ); | |
| 37 | + esc_html_e( sprintf( __('Filtered %s', 'filter-everything'), '('.$wpc_found_posts.')' ) ); | |
| 26 | 38 | } else { |
| 27 | 39 | esc_html_e('Filters', 'filter-everything'); |
| 28 | 40 | } |
| 29 | 41 | |