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 +33 -61 1.3.3 → 1.5.9 View file →
@@ -153,22 +153,37 @@
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
170 +
161 171 $this->data['is_edit_mode']= false;
162 172 if(Plugin::$instance->editor->is_edit_mode()){
163 173 $this->data['is_edit_mode']= true;
164 174 } else {
175 +
165 176 /* return false if no content */
166 - if(wdk_field_option ($this->data['settings']['field_id'], 'icon_id') == '')
177 + if($this->data['settings']['hide_onempty'] == 'yes' && $this->data['field_icon'] == '')
167 178 return false;
179 +
180 + /* return false if no content */
181 + if($this->data['field_icon'] == '')
182 + return false;
168 183 }
169 184
170 - echo $this->view('wdk-field-icon', $this->data);
185 + $this->view('wdk-field-icon', $this->data, true);
171 186 }
172 187
173 188
174 189 private function generate_controls_conf() {
@@ -209,8 +224,20 @@
209 224 'separator' => 'after',
210 225 ]
211 226 );
212 227
228 + $this->add_control(
229 + 'hide_onempty',
230 + [
231 + 'label' => __( 'Hide if empty', 'wpdirectorykit' ),
232 + 'type' => \Elementor\Controls_Manager::SWITCHER,
233 + 'label_on' => __( 'True', 'wpdirectorykit' ),
234 + 'label_off' => __( 'False', 'wpdirectorykit' ),
235 + 'return_value' => 'yes',
236 + 'default' => '',
237 + ]
238 + );
239 +
213 240 $this->end_controls_section();
214 241
215 242 }
216 243
@@ -226,68 +253,13 @@
226 253 'tab' => Controls_Manager::TAB_STYLE,
227 254 ]
228 255 );
229 256
230 - $this->add_responsive_control (
231 - 'field_group_icon_max_heigth',
232 - [
233 - 'label' => esc_html__('Max Height', 'wpdirectorykit'),
234 - 'type' => Controls_Manager::SLIDER,
235 - 'range' => [
236 - 'px' => [
237 - 'min' => 10,
238 - 'max' => 1500,
239 - ],
240 - 'vw' => [
241 - 'min' => 0,
242 - 'max' => 100,
243 - ],
244 - '%' => [
245 - 'min' => 0,
246 - 'max' => 100,
247 - ],
248 - ],
249 - 'size_units' => [ 'px', 'vw','%' ],
250 - 'default' => [
251 - 'unit' => 'px',
252 - 'size' => 18,
253 - ],
254 - 'selectors' => [
255 - '{{WRAPPER}} .wdk-field-icon' => 'max-width: {{SIZE}}{{UNIT}}',
256 - ],
257 - ]
257 + $selectors = array(
258 + 'normal' => '{{WRAPPER}} .wdk-field-icon img',
258 259 );
260 + $this->generate_renders_tabs($selectors, 'layout_image_dynamic', ['image_size_control','image_fit_control', 'height', 'width','css_filters']);
259 261
260 -
261 - $this->add_responsive_control (
262 - 'field_group_icon_max_width',
263 - [
264 - 'label' => esc_html__('Max Width', 'wpdirectorykit'),
265 - 'type' => Controls_Manager::SLIDER,
266 - 'range' => [
267 - 'px' => [
268 - 'min' => 10,
269 - 'max' => 1500,
270 - ],
271 - 'vw' => [
272 - 'min' => 0,
273 - 'max' => 100,
274 - ],
275 - '%' => [
276 - 'min' => 0,
277 - 'max' => 100,
278 - ],
279 - ],
280 - 'size_units' => [ 'px', 'vw','%' ],
281 - 'default' => [
282 - 'unit' => 'px',
283 - 'size' => 18,
284 - ],
285 - 'selectors' => [
286 - '{{WRAPPER}} .wdk-field-icon' => 'max-width: {{SIZE}}{{UNIT}}',
287 - ],
288 - ]
289 - );
290 262
291 263 $this->end_controls_section();
292 264 /* END special for some elements */
293 265 }