| @@ -15,22 +15,29 @@ | ||
| 15 | 15 | if ( ! defined('ABSPATH') ) { |
| 16 | 16 | exit; |
| 17 | 17 | } |
| 18 | 18 | $args = [ |
| 19 | - 'hide' => $view_args['ask_to_select_parent'] | |
| 19 | + 'hide' => $view_args['ask_to_select_parent'], | |
| 20 | + 'use_apply_button' => $view_args['use_apply_button'], | |
| 21 | + 'hide_empty' => $set['hide_empty']['value'], | |
| 22 | + 'hide_empty_filter' => isset($set['hide_empty_filter']['value']) ? $set['hide_empty_filter']['value'] : '', | |
| 20 | 23 | ]; |
| 21 | 24 | $selected_and_above_status = (isset($filter['selected_and_above']) && $filter['selected_and_above'] === 'yes') ? true : false; |
| 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); | |
| 23 | 27 | ?> |
| 24 | -<div class="<?php echo flrt_filter_class( $filter, [], $terms, $args ); // Already escaped ?>" data-fid="<?php echo esc_attr( $filter['ID'] ); ?>"> | |
| 28 | +<div class="wpc-stars-rating-block <?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 | 29 | <?php flrt_filter_header( $filter, $terms ); // Safe, escaped ?> |
| 26 | 30 | <div class="flrt-stars-wpc-filter-content <?php echo esc_attr( flrt_filter_content_class( $filter ) ); ?>" data-selected-and-above="<?php echo $selected_and_above_status; ?>" data-show-term-count="<?php echo ( $set['show_count']['value'] === 'yes' ) ? true : false; ?>"> |
| 27 | 31 | <ul class="flrt-stars-filter wpc-filters-ul-list wpc-filters-radio wpc-filters-list-<?php echo esc_attr( $filter['ID'] ); ?>"> |
| 28 | 32 | <?php if( ! empty( $terms ) || $view_args['ask_to_select_parent']) : |
| 29 | 33 | |
| 30 | - if( $view_args['ask_to_select_parent'] !== false ) { ?> | |
| 31 | - <li><?php echo esc_html( $view_args['ask_to_select_parent'] ); ?></li> | |
| 34 | + if( $view_args['ask_to_select_parent'] !== false && !$view_args['use_apply_button'] ) { ?> | |
| 35 | + <li><?php echo esc_html( $view_args['ask_to_select_parent']); ?></li> | |
| 32 | 36 | <?php } else { |
| 37 | + if( $view_args['ask_to_select_parent'] !== false && $view_args['use_apply_button'] ) { ?> | |
| 38 | + <li class="wpc-ask-to-parent-display"><?php echo esc_html( $view_args['ask_to_select_parent']); ?></li> | |
| 39 | + <?php } | |
| 33 | 40 | $flrt_rating_slug = []; |
| 34 | 41 | if($selected_and_above_status){ |
| 35 | 42 | $i = 1; |
| 36 | 43 | foreach ($terms as $id => $term_object){ |
| @@ -67,9 +74,9 @@ | ||
| 67 | 74 | } |
| 68 | 75 | |
| 69 | 76 | $slug = $term_object->slug; |
| 70 | 77 | |
| 71 | - $link = $url_manager->getTermUrl($slug, $filter['e_name'], $filter['entity'] ); | |
| 78 | + $link = flrt_get_filtered_term_url($term_object, $filter, $url_manager); | |
| 72 | 79 | if($selected_and_above_status){ |
| 73 | 80 | if(isset($filter['values'][0])){ |
| 74 | 81 | if($filter['values'][0] === $slug) $link = $url_manager->getTermUrl($slug, $filter['e_name'], $filter['entity'], '', ['rating_slug' => $slug]); |
| 75 | 82 | } |
| @@ -92,13 +99,11 @@ | ||
| 92 | 99 | |
| 93 | 100 | ?> |
| 94 | 101 | <li class="wpc-radio-item wpc-term-item wpc-term-count-<?php echo esc_attr( $term_object->cross_count ); ?> wpc-term-id-<?php echo esc_attr($id); ?>" id="<?php flrt_term_id('term', $filter, $id); ?>"> |
| 95 | 102 | <div class="wpc-term-item-content-wrapper"> |
| 96 | - <input <?php checked( 1, $checked ); disabled( 1, $disabled ) ?> type="radio" data-wpc-link="<?php echo esc_url( $link ); ?>" name="<?php echo esc_attr( $name ); ?>" id="<?php flrt_term_id('radio', $filter, $id); ?>" class="flrt-star-input"/> | |
| 103 | + <input <?php checked( 1, $checked ); disabled( 1, $disabled ) ?> type="radio" data-wpc-link="<?php echo esc_url( $link ); ?>" name="<?php echo esc_attr( $name ); ?>" id="<?php flrt_term_id('radio', $filter, $id); ?>" data-wpc-e-name="<?php echo esc_attr($filter['e_name']); ?>" data-wpc-slug="<?php echo esc_attr($term_object->slug); ?>" class="flrt-star-input" data-term-id="<?php echo esc_attr($id); ?>" data-rating-num="<?php echo $rating_num;?>"<?php echo ($checked) ? ' data-wpc-was-checked="true"' : ''; ?>/> | |
| 97 | 104 | <label class="flrt-star-label flrt-rating-numb-<?php echo $rating_num;?> <?php echo ($star_switch) ? ' flrt-star-label-hover' : '';?><?php echo ($checked) ? ' flrt-star-label-checked flrt-star-label-hover' : '';?><?php echo ($selected_and_above_status && !$checked) ? ' flrt-star-label-not-checked flrt-remove-star-check' : '';?>" data-rating-num="<?php echo $rating_num;?>" for="<?php flrt_term_id('radio', $filter, $id); ?>" data-wpc-term-count="<?php echo $data_wpc_term_count; ?>" data-star-rating-index="<?php echo $rating_num;?>"> |
| 98 | - <a <?php echo $link_attributes; ?>> | |
| 99 | - <?php echo flrt_rating_star();?> | |
| 100 | - </a> | |
| 105 | + <?php echo apply_filters( 'wpc_filters_rating_term_html', '<a '.$link_attributes.'>'.flrt_rating_star().'</a>', $link_attributes, $term_object, $filter ); ?> | |
| 101 | 106 | </label></div></li> |
| 102 | 107 | <?php $rating_num++; |
| 103 | 108 | } |
| 104 | 109 | } /* end foreach */ |