PluginProbe
WP Directory Kit / 1.5.9
WP Directory Kit v1.5.9
1.5.9 1.5.7 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 All 37 releases
wpdirectorykit / application / views / search_fields / DATE.php

DATE.php in WP Directory Kit 1.5.9, at application/views/search_fields/DATE.php

70 lines 3.4 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 DATE.
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 $field_key = 'field_'.wmvc_show_data('idfield',$field_data);
15 $field_attr_id = 'wdk_field_'.wmvc_show_data('idfield', $field_data);
16 $placeholder = wmvc_show_data('field_label', $field_data);
17 $field_value = '';
18 // Dynamic field values are registered in the translation catalog separately.
19 // phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText
20 $placeholder = esc_html__($placeholder,'wpdirectorykit');
21
22 $query_type = wmvc_show_data('query_type', $field_data, '');
23
24 if(!empty($query_type) && $query_type !='min_max')
25 $field_key .='_'.$query_type;
26
27 if(isset($predefinedfields_query) && !empty($predefinedfields_query[$field_key])) {
28 $field_value = sanitize_text_field($predefinedfields_query[$field_key]);
29 }
30
31 if(isset($_GET[$field_key])) {
32 $field_value = sanitize_text_field(wp_unslash($_GET[$field_key]));
33 }
34
35 if($query_type =='min')
36 $placeholder = esc_html__('Min','wpdirectorykit').' '.$placeholder;
37
38 if($query_type =='max')
39 $placeholder = esc_html__('Max','wpdirectorykit').' '.$placeholder;
40
41 wdk_search_fields_toggle();
42 ?>
43
44 <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)); ?>
45 wdk_field_id_<?php echo esc_attr(wmvc_show_data('idfield',$field_data));?>">
46 <label class="wdk-field-label"><?php
47 // Dynamic field values are registered in the translation catalog separately.
48 // phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText
49 echo esc_html__(wmvc_show_data('field_label', $field_data),'wpdirectorykit'); ?></label>
50 <div class="wdk-field-group">
51 <?php if($query_type == 'min_max'):?>
52 <div class="wdk-row min_max_row">
53 <div class="wdk-col wdk-col-6">
54 <input class="wdk-control wdk-fielddate" name="<?php echo esc_attr($field_key.'_min'); ?>" type="text" id="<?php echo esc_attr($field_attr_id.'_min'); ?>" value="<?php echo (isset($_GET[$field_key.'_min'])) ? esc_attr($_GET[$field_key.'_min']) : ''; ?>" placeholder="<?php echo esc_attr__('Min','wpdirectorykit').' '.esc_attr(trim($placeholder));?>">
55 </div>
56 <div class="wdk-col wdk-col-6">
57 <input class="wdk-control wdk-fielddate" name="<?php echo esc_attr($field_key.'_max'); ?>" type="text" id="<?php echo esc_attr($field_attr_id.'_max'); ?>" value="<?php echo (isset($_GET[$field_key.'_max'])) ? esc_attr($_GET[$field_key.'_max']) : ''; ?>" placeholder="<?php echo esc_attr__('Max','wpdirectorykit').' '.esc_attr(trim($placeholder));?>">
58 </div>
59 </div>
60 <?php else:?>
61 <input class="wdk-control wdk-fielddate" name="<?php echo esc_attr($field_key); ?>" type="text" id="<?php echo esc_attr($field_attr_id); ?>" value="<?php echo esc_attr($field_value); ?>" placeholder="<?php echo esc_attr(trim($placeholder));?>">
62 <?php endif;?>
63 </div>
64 </div>
65
66 <?php
67 wp_enqueue_script( 'jquery-ui-datepicker' );
68 wp_enqueue_style('jquery-ui');
69 ?>
70