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
← All changes | application/views/search_fields/LOCATION_CHECKBOXES.php +20 -2 1.2.9 → 1.5.9 View file →
@@ -28,9 +28,9 @@
28 28 $Winter_MVC_WDK->model('location_m');
29 29 $location = $Winter_MVC_WDK->location_m->get($custom_field_value, TRUE);
30 30
31 31 /* if root search childs */
32 - if(empty(wmvc_show_data('parent_id', $location, false, TRUE, TRUE))) {
32 + if($location) {
33 33 $filter_ids = wdk_location_get_all_childs($custom_field_value);
34 34 if(!empty($filter_ids)) {
35 35 $filter_ids[] = $custom_field_value;
36 36 if(in_array($field_value, $filter_ids) === FALSE) {
@@ -36,8 +36,11 @@
36 36 if(in_array($field_value, $filter_ids) === FALSE) {
37 37 $field_value = $custom_field_value;
38 38 }
39 39 }
40 + } else {
41 + /* location missing */
42 + $custom_field_value = null;
40 43 }
41 44 }
42 45
43 46 if(isset($_GET[$field_key])) {
@@ -62,7 +65,22 @@
62 65 <?php
63 66 wp_enqueue_style( 'wdk-treefield-checkboxes');
64 67 wp_enqueue_script( 'wdk-treefield-checkboxes');
65 68 ?>
66 - <?php echo wdk_treefield_option_checkboxes ('search_location', 'location_m', $field_value, 'location_title', '', __('All Locations', 'wpdirectorykit'), $filter_ids, FALSE, '', $hide_fields);?>
69 + <?php
70 + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped, WordPress.WP.I18n.NonSingularStringLiteralText
71 + echo wdk_treefield_option_checkboxes(
72 + 'search_location',
73 + 'location_m',
74 + $field_value,
75 + 'location_title',
76 + '',
77 + __('All Locations', 'wpdirectorykit'),
78 + $filter_ids,
79 + FALSE,
80 + '',
81 + $hide_fields
82 + );
83 + ?>
84 +
67 85 </div>
68 86 </div>