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 | elementor-elements/classes/wdk-field-icon.php +16 -62 1.3.8 → 1.5.9 View file →
@@ -153,10 +153,19 @@
153 153 if(!empty($this->data['settings']['field_id'])) {
154 154 if(strpos($this->data['settings']['field_id'],'__') !== FALSE){
155 155 $this->data['settings']['field_id'] = substr($this->data['settings']['field_id'], strpos($this->data['settings']['field_id'],'__')+2);
156 156 }
157 - if(wdk_field_option ($this->data['settings']['field_id'], 'icon_id'))
157 + if($this->data['settings']['field_id'] == 'category_id') {
158 + $this->WMVC->model('category_m');
159 + $tree_data = $this->WMVC->category_m->get(wdk_field_value ($this->data['settings']['field_id'], $wdk_listing_id), TRUE);
160 + $this->data['field_icon'] = wmvc_show_data('icon_id', $tree_data);
161 + } else if($this->data['settings']['field_id'] == 'location_id') {
162 + $this->WMVC->model('location_id');
163 + $tree_data = $this->WMVC->location_id->get(wdk_field_value ($this->data['settings']['field_id'], $wdk_listing_id), TRUE);
164 + $this->data['field_icon'] = wmvc_show_data('icon_id', $tree_data);
165 + } else {
158 166 $this->data['field_icon'] = wdk_field_option ($this->data['settings']['field_id'], 'icon_id');
167 + }
159 168 }
160 169
161 170
162 171 $this->data['is_edit_mode']= false;
@@ -164,17 +173,17 @@
164 173 $this->data['is_edit_mode']= true;
165 174 } else {
166 175
167 176 /* return false if no content */
168 - if($this->data['settings']['hide_onempty'] == 'yes' && wdk_field_value($this->data['settings']['field_id'], $wdk_listing_id) == '')
177 + if($this->data['settings']['hide_onempty'] == 'yes' && $this->data['field_icon'] == '')
169 178 return false;
170 179
171 180 /* return false if no content */
172 - if(wdk_field_option ($this->data['settings']['field_id'], 'icon_id') == ''|| wdk_field_option ($this->data['settings']['field_id'], 'icon_id') == 0)
181 + if($this->data['field_icon'] == '')
173 182 return false;
174 183 }
175 184
176 - echo $this->view('wdk-field-icon', $this->data);
185 + $this->view('wdk-field-icon', $this->data, true);
177 186 }
178 187
179 188
180 189 private function generate_controls_conf() {
@@ -244,68 +253,13 @@
244 253 'tab' => Controls_Manager::TAB_STYLE,
245 254 ]
246 255 );
247 256
248 - $this->add_responsive_control (
249 - 'field_group_icon_max_heigth',
250 - [
251 - 'label' => esc_html__('Max Height', 'wpdirectorykit'),
252 - 'type' => Controls_Manager::SLIDER,
253 - 'range' => [
254 - 'px' => [
255 - 'min' => 10,
256 - 'max' => 1500,
257 - ],
258 - 'vw' => [
259 - 'min' => 0,
260 - 'max' => 100,
261 - ],
262 - '%' => [
263 - 'min' => 0,
264 - 'max' => 100,
265 - ],
266 - ],
267 - 'size_units' => [ 'px', 'vw','%' ],
268 - 'default' => [
269 - 'unit' => 'px',
270 - 'size' => 18,
271 - ],
272 - 'selectors' => [
273 - '{{WRAPPER}} .wdk-field-icon' => 'max-width: {{SIZE}}{{UNIT}}',
274 - ],
275 - ]
257 + $selectors = array(
258 + 'normal' => '{{WRAPPER}} .wdk-field-icon img',
276 259 );
260 + $this->generate_renders_tabs($selectors, 'layout_image_dynamic', ['image_size_control','image_fit_control', 'height', 'width','css_filters']);
277 261
278 -
279 - $this->add_responsive_control (
280 - 'field_group_icon_max_width',
281 - [
282 - 'label' => esc_html__('Max Width', 'wpdirectorykit'),
283 - 'type' => Controls_Manager::SLIDER,
284 - 'range' => [
285 - 'px' => [
286 - 'min' => 10,
287 - 'max' => 1500,
288 - ],
289 - 'vw' => [
290 - 'min' => 0,
291 - 'max' => 100,
292 - ],
293 - '%' => [
294 - 'min' => 0,
295 - 'max' => 100,
296 - ],
297 - ],
298 - 'size_units' => [ 'px', 'vw','%' ],
299 - 'default' => [
300 - 'unit' => 'px',
301 - 'size' => 18,
302 - ],
303 - 'selectors' => [
304 - '{{WRAPPER}} .wdk-field-icon' => 'max-width: {{SIZE}}{{UNIT}}',
305 - ],
306 - ]
307 - );
308 262
309 263 $this->end_controls_section();
310 264 /* END special for some elements */
311 265 }