PluginProbe
WP Directory Kit / 1.1.0
WP Directory Kit v1.1.0
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.0, at application/views/search_fields/DROPDOWN.php

71 lines 2.9 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 $placeholder = wmvc_show_data('field_label', $field_data);
18 $field_value = '';
19
20 $query_type = wmvc_show_data('query_type', $field_data, '');
21
22 if(!empty($query_type) && $query_type !='min_max')
23 $field_key .='_'.$query_type;
24
25 if(isset($predefinedfields_query) && !empty($predefinedfields_query[$field_key])) {
26 $field_value = sanitize_text_field($predefinedfields_query[$field_key]);
27 }
28
29 if(isset($_GET[$field_key])) {
30 $field_value = sanitize_text_field($_GET[$field_key]);
31 }
32
33 if($query_type =='min')
34 $placeholder = esc_html__('Min','wpdirectorykit').' '.$placeholder;
35
36 if($query_type =='max')
37 $placeholder = esc_html__('Max','wpdirectorykit').' '.$placeholder;
38
39 $values = array();
40 if(!empty(wmvc_show_data('values_list', $field_data))){
41 $values = explode(',', wmvc_show_data('values_list', $field_data));
42 $values = array(''=> $placeholder) + array_combine($values, $values);
43 }
44 wdk_search_fields_toggle();
45 ?>
46
47 <div class="wdk-field wdk-col <?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)); ?>">
48 <label class="wdk-field-label"><?php echo esc_html(wmvc_show_data('field_label', $field_data)); ?></label>
49 <div class="wdk-field-group">
50 <?php if($query_type == 'min_max'):?>
51 <div class="wdk-row min_max_row">
52 <div class="wdk-col-6">
53 <?php echo wmvc_select_option($field_key.'_min' , array_merge($values, array(''=> esc_html__('Min','wpdirectorykit').' '.$placeholder)), (isset($_GET[$field_key.'_min'])) ? esc_attr($_GET[$field_key.'_min']) : '', 'class="wdk-control"'); ?>
54 </div>
55 <div class="wdk-col-6">
56 <?php echo wmvc_select_option($field_key.'_max', array_merge($values, array(''=> esc_html__('Max','wpdirectorykit').' '.$placeholder)), (isset($_GET[$field_key.'_max'])) ? esc_attr($_GET[$field_key.'_max']) : '', 'class="wdk-control"'); ?>
57 </div>
58 </div>
59 <?php else:?>
60 <?php echo wmvc_select_option($field_key , $values, $field_value, 'class="wdk-control"'); ?>
61 <?php endif;?>
62 </div>
63 </div>
64
65 <?php
66 wp_enqueue_script( 'jquery-ui-core', false, array('jquery') );
67 wp_enqueue_script( 'jquery-ui-sortable', false, array('jquery') );
68 wp_enqueue_script( 'jquery-ui-selectmenu', false, array('jquery') );
69 wp_enqueue_style( 'jquery-ui');
70 wp_enqueue_style( 'jquery-ui-selectmenu');
71 ?>