PluginProbe
WP Directory Kit / 1.1.6
WP Directory Kit v1.1.6
1.5.6 1.5.5 1.5.4 1.5.3 trunk 1.1.0 1.1.6 1.1.8 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.8 1.4.0 1.4.1 All 35 releases
wpdirectorykit / application / views / search_fields / DROPDOWN.php

DROPDOWN.php in WP Directory Kit 1.1.6, at application/views/search_fields/DROPDOWN.php

78 lines 3.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * The template for Search field DROPDOWN.
4 *
5 * This is the template that field layout for search form
6 *
7 */
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit; // Exit if accessed directly.
11 }
12 ?>
13 <?php
14
15 $field_key = 'field_'.wmvc_show_data('idfield',$field_data);
16 $field_attr_id = 'wdk_field_'.wmvc_show_data('idfield', $field_data);
17
18 $placeholder = wmvc_show_data('field_label', $field_data);
19 if(!empty(wmvc_show_data('placeholder', $field_data,'')))
20 $placeholder = wmvc_show_data('placeholder', $field_data);
21
22 $field_value = '';
23
24 $query_type = wmvc_show_data('query_type', $field_data, '');
25
26 if(!empty($query_type) && $query_type !='min_max')
27 $field_key .='_'.$query_type;
28
29 if(isset($predefinedfields_query) && !empty($predefinedfields_query[$field_key])) {
30 $field_value = sanitize_text_field($predefinedfields_query[$field_key]);
31 }
32
33 if(isset($_GET[$field_key])) {
34 $field_value = sanitize_text_field($_GET[$field_key]);
35 }
36
37 if($query_type =='min')
38 $placeholder = esc_html__('Min','wpdirectorykit').' '.$placeholder;
39
40 if($query_type =='max')
41 $placeholder = esc_html__('Max','wpdirectorykit').' '.$placeholder;
42
43 $values = array();
44
45 if(!empty(wmvc_show_data('values_list', $field_data)) && strpos(wmvc_show_data('values_list', $field_data), ',') !== FALSE){
46 $values = explode(',', wmvc_show_data('values_list', $field_data));
47 $values = array_combine($values, $values);
48 }
49
50 wdk_search_fields_toggle();
51 ?>
52
53 <div class="wdk-field wdk-col wdk_search_<?php echo esc_attr($field_key);?> <?php if($query_type == 'min_max'):?>min_max_wdk-field<?php endif;?> <?php echo esc_attr(wmvc_show_data('field_type', $field_data)); ?> <?php echo esc_attr(wmvc_show_data('class', $field_data)); ?>
54 wdk_field_id_<?php echo wmvc_show_data('idfield',$field_data);?>">
55 <label class="wdk-field-label"><?php echo esc_html(wmvc_show_data('field_label', $field_data)); ?></label>
56 <div class="wdk-field-group">
57 <?php if($query_type == 'min_max'):?>
58 <div class="wdk-row min_max_row">
59 <div class="wdk-col-6">
60 <?php echo wmvc_select_option($field_key.'_min' , (array(''=> __('Min', 'wpdirectorykit').' '.$placeholder) + $values), (isset($_GET[$field_key.'_min'])) ? esc_attr($_GET[$field_key.'_min']) : '', 'class="wdk-control"'); ?>
61 </div>
62 <div class="wdk-col-6">
63 <?php echo wmvc_select_option($field_key.'_max', (array(''=> __('Max', 'wpdirectorykit').' '.$placeholder) + $values), (isset($_GET[$field_key.'_max'])) ? esc_attr($_GET[$field_key.'_max']) : '', 'class="wdk-control"'); ?>
64 </div>
65 </div>
66 <?php else:?>
67 <?php echo wmvc_select_option($field_key , (array(''=> $placeholder) + $values), $field_value, 'class="wdk-control"'); ?>
68 <?php endif;?>
69 </div>
70 </div>
71
72 <?php
73 wp_enqueue_script( 'jquery-ui-core', false, array('jquery') );
74 wp_enqueue_script( 'jquery-ui-sortable', false, array('jquery') );
75 wp_enqueue_script( 'jquery-ui-selectmenu', false, array('jquery') );
76 wp_enqueue_style( 'jquery-ui');
77 wp_enqueue_style( 'jquery-ui-selectmenu');
78 ?>