| 1 |
<?php |
| 2 |
/** |
| 3 |
* The Template for displaying filter checkboxes. |
| 4 |
* |
| 5 |
* This template can be overridden by copying it to yourtheme/filters/checkboxes.php. |
| 6 |
* |
| 7 |
* $set - array, with the Filter Set parameters |
| 8 |
* $filter - array, with the Filter parameters |
| 9 |
* $url_manager - object, of the UrlManager PHP class |
| 10 |
* $terms - array, with objects of all filter terms except excluded |
| 11 |
* |
| 12 |
* @see https://filtereverything.pro/resources/templates-overriding/ |
| 13 |
*/ |
| 14 |
|
| 15 |
if ( ! defined('ABSPATH') ) { |
| 16 |
exit; |
| 17 |
} |
| 18 |
|
| 19 |
$args = [ |
| 20 |
'hide' => $view_args['ask_to_select_parent'], |
| 21 |
'use_apply_button' => $view_args['use_apply_button'], |
| 22 |
'hide_empty' => $set['hide_empty']['value'], |
| 23 |
'hide_empty_filter' => isset($set['hide_empty_filter']['value']) ? $set['hide_empty_filter']['value'] : '', |
| 24 |
]; |
| 25 |
$parent_filter_apply_button_data = flrt_parent_filter_apply_button_data($filter, $view_args); |
| 26 |
$parent_filter_apply_class = flrt_parent_filter_apply_class($filter, $view_args, $terms); |
| 27 |
$is_hide_empty_terms = (isset($set['hide_empty']['value']) && $set['hide_empty']['value'] === 'yes'); |
| 28 |
$isMoreLess = flrtIsMoreLess($filter); |
| 29 |
$isParentFilter = flrtParentFilter($filter); |
| 30 |
?> |
| 31 |
<div class="<?php echo flrt_filter_class( $filter, [], $terms, $args ); // Already escaped ?><?php echo $parent_filter_apply_class; ?>" data-fid="<?php echo esc_attr( $filter['ID'] ); ?>" data-filter-e-name="<?php echo esc_attr($filter['e_name']); ?>"<?php echo $parent_filter_apply_button_data; ?>> |
| 32 |
<?php flrt_filter_header( $filter, $terms ); // Safe, escaped ?> |
| 33 |
<div class="<?php echo esc_attr( flrt_filter_content_class( $filter ) ); ?>"> |
| 34 |
<?php flrt_filter_search_field( $filter, $view_args, $terms ); ?> |
| 35 |
<ul class="wpc-filters-ul-list wpc-filters-checkboxes wpc-filters-list-<?php echo esc_attr( $filter['ID'] ); ?>"><?php |
| 36 |
|
| 37 |
if( ! empty( $terms ) || $view_args['ask_to_select_parent'] ): |
| 38 |
|
| 39 |
if( $view_args['ask_to_select_parent'] !== false && !$view_args['use_apply_button'] ) { ?> |
| 40 |
<li class="wpc-ask-to-parent-display"><?php echo esc_html( $view_args['ask_to_select_parent'] ); ?></li> |
| 41 |
<?php } else { |
| 42 |
if( $view_args['ask_to_select_parent'] !== false && $view_args['use_apply_button'] ) { ?> |
| 43 |
<li class="wpc-ask-to-parent-display"><?php echo esc_html( $view_args['ask_to_select_parent'] ); ?></li> |
| 44 |
<?php } |
| 45 |
$args = array( |
| 46 |
'url_manager' => $url_manager, |
| 47 |
'filter' => $filter, |
| 48 |
'show_count' => $set['show_count']['value'], |
| 49 |
'set' => $set, |
| 50 |
'use_apply_button' => $view_args['use_apply_button'], |
| 51 |
'ask_to_select_parent' => $view_args['ask_to_select_parent'], |
| 52 |
'is_hide_empty_terms' => $is_hide_empty_terms, |
| 53 |
'isMoreLess' => $isMoreLess, |
| 54 |
'isParentFilter' => $isParentFilter, |
| 55 |
); |
| 56 |
|
| 57 |
echo flrt_filter_walk_terms_tree( $terms, $args ); |
| 58 |
} |
| 59 |
else: |
| 60 |
flrt_filter_no_terms_message(); |
| 61 |
endif; |
| 62 |
|
| 63 |
?> </ul> |
| 64 |
<?php flrt_filter_more_less( $filter ); ?> |
| 65 |
</div> |
| 66 |
</div> |