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/CATEGORY.php +59 -6 1.3.6 → 1.5.9 View file →
@@ -14,8 +14,10 @@
14 14 $field_key = 'search_category';
15 15 $field_attr_id = 'wdk_search_'.wmvc_show_data('idfield', $field_data);
16 16 $placeholder = wmvc_show_data('field_label', $field_data);
17 17 $field_value = '';
18 +// Dynamic field values are registered in the translation catalog separately.
19 +// phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText
18 20 $placeholder = esc_html__($placeholder,'wpdirectorykit');
19 21
20 22 $filter_ids = array();
21 23 if(isset($predefinedfields_query) && !empty($predefinedfields_query[$field_key])) {
@@ -22,9 +24,9 @@
22 24 $field_value = intval($predefinedfields_query[$field_key]);
23 25 }
24 26
25 27 if(isset($_GET['category_root'])) {
26 - $predefinedfields_query['custom_category_root'] = sanitize_text_field($_GET['category_root']);
28 + $predefinedfields_query['custom_category_root'] = sanitize_text_field(wp_unslash($_GET['category_root']));
27 29 }
28 30
29 31 if(isset($predefinedfields_query) && !empty($predefinedfields_query['custom_category_root'])) {
30 32 $custom_field_value = intval($predefinedfields_query['custom_category_root']);
@@ -123,9 +125,29 @@
123 125 <div data-level="<?php echo esc_attr($level);?>" data-field="<?php echo esc_attr($field_key); ?>" class="wdk-field wdk-col wdk_treefield_dropdown <?php echo esc_attr(wmvc_show_data('field_type', $field_data)); ?> <?php echo esc_attr(wmvc_show_data('class', $field_data)); ?>
124 126 wdk_field_id_category">
125 127 <label class="wdk-field-label"><?php echo esc_html(wmvc_show_data('field_label', $field_data)); ?></label>
126 128 <div class="wdk-field-group">
127 - <?php echo wmvc_select_option('category_'.$level, $values_list, $category, 'class="wdk-control"');?>
129 + <?php
130 + echo wp_kses(
131 + wmvc_select_option('category_'.$level, $values_list, $category, 'class="wdk-control"'),
132 + array(
133 + 'select' => array(
134 + 'id' => true,
135 + 'name' => true,
136 + 'class' => true,
137 + 'style' => true,
138 + 'multiple' => true,
139 + 'size' => true,
140 + ),
141 + 'option' => array(
142 + 'value' => true,
143 + 'selected' => true,
144 + 'disabled' => true,
145 + ),
146 + )
147 + );
148 + ?>
149 +
128 150 </div>
129 151 </div>
130 152
131 153 <?php
@@ -145,9 +167,29 @@
145 167
146 168 <div data-level="<?php echo esc_attr($level);?>" data-field="<?php echo esc_attr($field_key); ?>" class="wdk-field wdk-col wdk_treefield_dropdown <?php echo esc_attr(wmvc_show_data('field_type', $field_data)); ?> <?php echo esc_attr(wmvc_show_data('class', $field_data)); ?>">
147 169 <label class="wdk-field-label"><?php echo esc_html(wmvc_show_data('field_label', $field_data)); ?></label>
148 170 <div class="wdk-field-group">
149 - <?php echo wmvc_select_option('category_'.$level, $values_list, NULL, 'class="wdk-control"');?>
171 + <?php
172 + echo wp_kses(
173 + wmvc_select_option('category_'.$level, $values_list, NULL, 'class="wdk-control"'),
174 + array(
175 + 'select' => array(
176 + 'id' => true,
177 + 'name' => true,
178 + 'class' => true,
179 + 'style' => true,
180 + 'multiple' => true,
181 + 'size' => true,
182 + ),
183 + 'option' => array(
184 + 'value' => true,
185 + 'selected' => true,
186 + 'disabled' => true,
187 + ),
188 + )
189 + );
190 + ?>
191 +
150 192 </div>
151 193 </div>
152 194
153 195 <?php
@@ -159,17 +201,28 @@
159 201 <div class="wdk-field wdk-col <?php echo esc_attr(wmvc_show_data('field_type', $field_data)); ?> <?php echo esc_attr(wmvc_show_data('class', $field_data)); ?>">
160 202 <label class="wdk-field-label"><?php echo esc_html(wmvc_show_data('field_label', $field_data)); ?></label>
161 203 <div class="wdk-field-group">
162 204 <?php if(wdk_get_option('wdk_multi_categories_search_field_type') == 'select2'):?>
163 - <?php echo wdk_treefield_select_ajax ($field_key.'[]', 'category_m', $field_value, 'category_title','idcategory', '', __('All Categories', 'wpdirectorykit'), $filter_ids);?>
205 + <?php
206 + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped, WordPress.WP.I18n.NonSingularStringLiteralText
207 + echo wdk_treefield_select_ajax ($field_key.'[]', 'category_m', $field_value, 'category_title','idcategory', '', __('All Categories', 'wpdirectorykit'), $filter_ids);?>
164 208 <?php elseif(wdk_get_option('wdk_multi_categories_search_field_type') == 'wdk_treefield_checkboxes'):?>
165 209 <?php
166 210 wp_enqueue_style( 'wdk-treefield-checkboxes');
167 211 wp_enqueue_script( 'wdk-treefield-checkboxes');
168 212 ?>
169 - <?php echo wdk_treefield_option_checkboxes ('search_category', 'category_m', $field_value, 'category_title', '', __('All Categories', 'wpdirectorykit'), $filter_ids);?>
213 + <?php
214 + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped, WordPress.WP.I18n.NonSingularStringLiteralText
215 + echo wdk_treefield_option_checkboxes('search_category', 'category_m', $field_value, 'category_title', '', __('All Categories', 'wpdirectorykit'), $filter_ids);
216 +
217 + ?>
218 +
170 219 <?php else:?>
171 - <?php echo wdk_treefield_option ('search_category', 'category_m', $field_value, 'category_title', '', __('All Categories', 'wpdirectorykit'), $filter_ids, FALSE, '', $hide_fields);?>
220 + <?php
221 + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped, WordPress.WP.I18n.NonSingularStringLiteralText
222 + echo wdk_treefield_option('search_category', 'category_m', $field_value, 'category_title', '', __('All Categories', 'wpdirectorykit'), $filter_ids, FALSE, '', $hide_fields);
223 + ?>
224 +
172 225 <?php endif;?>
173 226 </div>
174 227 </div>
175 228 <?php endif;?>