| @@ -16,13 +16,20 @@ | ||
| 16 | 16 | exit; |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | $args = [ |
| 20 | - 'hide' => $view_args['ask_to_select_parent'] | |
| 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'] : '', | |
| 21 | 24 | ]; |
| 22 | - | |
| 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); | |
| 23 | 30 | ?> |
| 24 | -<div class="<?php echo flrt_filter_class( $filter, [], $terms, $args ); // Already escaped ?>" data-fid="<?php echo esc_attr( $filter['ID'] ); ?>"> | |
| 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; ?>> | |
| 25 | 32 | <?php flrt_filter_header( $filter, $terms ); // Safe, escaped ?> |
| 26 | 33 | <div class="<?php echo esc_attr( flrt_filter_content_class( $filter ) ); ?>"> |
| 27 | 34 | <?php flrt_filter_search_field( $filter, $view_args, $terms ); ?> |
| 28 | 35 | <ul class="wpc-filters-ul-list wpc-filters-checkboxes wpc-filters-list-<?php echo esc_attr( $filter['ID'] ); ?>"><?php |
| @@ -28,17 +35,24 @@ | ||
| 28 | 35 | <ul class="wpc-filters-ul-list wpc-filters-checkboxes wpc-filters-list-<?php echo esc_attr( $filter['ID'] ); ?>"><?php |
| 29 | 36 | |
| 30 | 37 | if( ! empty( $terms ) || $view_args['ask_to_select_parent'] ): |
| 31 | 38 | |
| 32 | - if( $view_args['ask_to_select_parent'] !== false ) { ?> | |
| 33 | - <li><?php echo esc_html( $view_args['ask_to_select_parent'] ); ?></li> | |
| 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> | |
| 34 | 41 | <?php } else { |
| 35 | - | |
| 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 } | |
| 36 | 45 | $args = array( |
| 37 | 46 | 'url_manager' => $url_manager, |
| 38 | 47 | 'filter' => $filter, |
| 39 | 48 | 'show_count' => $set['show_count']['value'], |
| 40 | - 'set' => $set | |
| 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, | |
| 41 | 55 | ); |
| 42 | 56 | |
| 43 | 57 | echo flrt_filter_walk_terms_tree( $terms, $args ); |
| 44 | 58 | } |