| @@ -12,12 +12,24 @@ | ||
| 12 | 12 | ?> |
| 13 | 13 | <?php |
| 14 | 14 | $results_page = wmvc_show_data('conf_link', $settings); |
| 15 | 15 | if(!is_array($results_page) && !empty($results_page)) { |
| 16 | - $results_page = get_permalink($results_page); | |
| 16 | + //$results_page = get_permalink($results_page); | |
| 17 | 17 | } else { |
| 18 | - $results_page = get_permalink(wdk_get_option('wdk_results_page')); | |
| 18 | + $results_page = wdk_get_option('wdk_results_page'); | |
| 19 | 19 | } |
| 20 | + | |
| 21 | +//get translation page | |
| 22 | +if(function_exists('PLL')) | |
| 23 | +{ | |
| 24 | + $results_page = pll_get_post($results_page); | |
| 25 | +} | |
| 26 | + | |
| 27 | +$results_page = get_permalink($results_page); | |
| 28 | + | |
| 29 | +$parent_id = null; | |
| 30 | +$hide_childs = false; | |
| 31 | + | |
| 20 | 32 | ?> |
| 21 | 33 | |
| 22 | 34 | <div class="wdk-element" id="wdk_el_<?php echo esc_html($id_element);?>"> |
| 23 | 35 | <div class="wdk-locations-tree"> |
| @@ -26,10 +38,21 @@ | ||
| 26 | 38 | <?php if(!empty($locations)):?> |
| 27 | 39 | <div class="wdk-col"> |
| 28 | 40 | <div class="location-block"> |
| 29 | 41 | <?php foreach ($locations as $key => $value):?> |
| 42 | + <?php | |
| 43 | + if(wmvc_show_data('disable_empty_listings', $settings) == 'yes') { | |
| 44 | + if(empty($value->listings_counter)) { | |
| 45 | + $parent_id = wmvc_show_data('idlocation', $value); | |
| 46 | + $hide_childs = true; | |
| 47 | + continue; | |
| 48 | + } | |
| 49 | + } | |
| 50 | + ?> | |
| 30 | 51 | <?php if(wmvc_show_data('parent_id', $value) == 0):?> |
| 31 | - | |
| 52 | + <?php | |
| 53 | + $hide_childs = false; | |
| 54 | + ?> | |
| 32 | 55 | <?php if($key != 0):?> |
| 33 | 56 | </ul> |
| 34 | 57 | </div> |
| 35 | 58 | </div> |
| @@ -35,34 +58,34 @@ | ||
| 35 | 58 | </div> |
| 36 | 59 | <div class="wdk-col"> |
| 37 | 60 | <div class="location-block"> |
| 38 | 61 | <?php endif;?> |
| 39 | - | |
| 40 | 62 | <h3 class="title <?php if(wmvc_show_data('show_icon', $settings) == 'yes' && wmvc_show_data('layout_image_type', $settings) == 'image'):?> image_top <?php endif;?>"> |
| 41 | 63 | <?php if(wmvc_show_data('show_icon', $settings) == 'yes'):?> |
| 42 | 64 | <?php if(wmvc_show_data('layout_image_type', $settings) == 'icon'):?> |
| 43 | 65 | <a href="<?php echo esc_url(wdk_url_suffix($results_page,'search_location='.wmvc_show_data('idlocation', $value)));?>#results"> |
| 44 | - <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id', 'icon_path'));?>" alt="<?php echo wmvc_show_data('location_title', $value);?>" class="wdk-icon"> | |
| 66 | + <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id', 'icon_path'));?>" alt="<?php echo esc_attr(wmvc_show_data('location_title', $value));?>" class="wdk-icon"> | |
| 45 | 67 | </a> |
| 46 | 68 | <?php elseif(wmvc_show_data('layout_image_type', $settings) == 'image'):?> |
| 47 | 69 | <a class="wdk-d-block" href="<?php echo esc_url(wdk_url_suffix($results_page,'search_location='.wmvc_show_data('idlocation', $value)));?>#results"> |
| 48 | - <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'image_id','image_path'));?>" alt="<?php echo wmvc_show_data('location_title', $value);?>" class="wdk-image"> | |
| 70 | + <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'image_id','image_path'));?>" alt="<?php echo esc_attr(wmvc_show_data('location_title', $value));?>" class="wdk-image"> | |
| 49 | 71 | </a> |
| 50 | 72 | <?php elseif(wmvc_show_data('layout_image_type', $settings) == 'font_icon'):?> |
| 51 | 73 | <span class="wdk-font-icon" style="background-color: <?php echo esc_attr(wmvc_show_data('location_color', $value));?>;"><i class="<?php echo esc_attr(wmvc_show_data('font_icon_code', $value));?>"></i></span> |
| 52 | 74 | <?php endif;?> |
| 53 | 75 | <?php endif;?> |
| 54 | - <a href="<?php echo esc_url(wdk_url_suffix($results_page,'search_location='.wmvc_show_data('idlocation', $value)));?>#results"> | |
| 55 | - <?php echo wmvc_show_data('location_title', $value);?> | |
| 76 | + <a href="<?php echo esc_url(wdk_url_suffix($results_page,'search_location='.wmvc_show_data('idlocation', $value)));?>#results" class="title-in"> | |
| 77 | + <?php echo esc_html(wmvc_show_data('location_title', $value));?> | |
| 56 | 78 | </a> |
| 57 | 79 | </h3> |
| 58 | 80 | <ul class="wdk-locations"> |
| 59 | 81 | <?php else:?> |
| 82 | + <?php if($hide_childs && $parent_id == wmvc_show_data('parent_id', $value)) continue;?> | |
| 60 | 83 | <li class="wdk-item"> |
| 61 | 84 | <a href="<?php echo esc_url(wdk_url_suffix($results_page,'search_location='.wmvc_show_data('idlocation', $value)));?>#results" class="wdk-link"> |
| 62 | 85 | <?php \Elementor\Icons_Manager::render_icon( $settings['item_icon_i'], [ 'aria-hidden' => 'true' ] );?> |
| 63 | - <span class="wdk-title"><?php echo wmvc_show_data('location_title', $value);?></span> | |
| 64 | - <span class="wdk-count"><?php echo wmvc_show_data('listings_counter', $value, 0);?></span> | |
| 86 | + <span class="wdk-title"><?php echo esc_html(wmvc_show_data('location_title', $value));?></span> | |
| 87 | + <span class="wdk-count"><?php echo esc_html(wmvc_show_data('listings_counter', $value, 0));?></span> | |
| 65 | 88 | </a> |
| 66 | 89 | </li> |
| 67 | 90 | <?php endif;?> |
| 68 | 91 | <?php endforeach;?> |