PluginProbe
UiCore Elements – Free widgets and templates for Elementor / 1.3.18
UiCore Elements – Free widgets and templates for Elementor v1.3.18
1.3.18 1.3.17 1.3.16 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.2.0 1.2.1 1.2.2 1.2.3 All 42 releases
← All changes | includes/widgets/icon-box.php +2047 -2025 1.2.0 → 1.3.18 View file →
@@ -1,5 +1,6 @@
1 1 <?php
2 +
2 3 namespace UiCoreElements;
3 4
4 5 use Elementor\Controls_Manager;
5 6 use Elementor\Group_Control_Border;
@@ -22,405 +23,423 @@
22 23
23 24 class IconBox extends UiCoreWidget
24 25 {
25 26
26 - public function get_name()
27 - {
28 - return 'uicore-icon-box';
29 - }
30 - public function get_title()
31 - {
32 - return __('Icon Box', 'uicore-elements');
33 - }
34 - public function get_icon()
35 - {
36 - return 'eicon-icon-box ui-e-widget';
37 - }
38 - public function get_categories()
39 - {
40 - return ['uicore'];
41 - }
42 - public function get_keywords()
43 - {
44 - return ['icon', 'features', 'info', 'box'];
45 - }
46 - public function get_styles()
47 - {
48 - return ['icon-box'];
49 - }
50 - public function get_scripts()
51 - {
52 - return [
27 + public function get_name()
28 + {
29 + return 'uicore-icon-box';
30 + }
31 + public function get_title()
32 + {
33 + return __('Icon Box', 'uicore-elements');
34 + }
35 + public function get_icon()
36 + {
37 + return 'eicon-icon-box ui-e-widget';
38 + }
39 + public function get_categories()
40 + {
41 + return ['uicore'];
42 + }
43 + public function get_keywords()
44 + {
45 + return ['icon', 'features', 'info', 'box'];
46 + }
47 + public function get_styles()
48 + {
49 + return ['icon-box'];
50 + }
51 + public function get_scripts()
52 + {
53 + return [
53 54 'icon-box' => [
54 55 'conditions' => [
55 - 'relation' => 'or',
56 - 'terms' => [
57 - [
58 - 'name' => 'description_animation',
59 - 'operator' => '==',
60 - 'value' => 'ui-e-animation-description-show',
61 - ],
62 - [
63 - 'name' => 'readmore_animation',
64 - 'operator' => '==',
65 - 'value' => 'ui-e-animation-rm-show',
66 - ],
67 - ],
68 - ],
56 + 'relation' => 'or',
57 + 'terms' => [
58 + [
59 + 'name' => 'description_animation',
60 + 'operator' => '==',
61 + 'value' => 'ui-e-animation-description-show',
62 + ],
63 + [
64 + 'name' => 'readmore_animation',
65 + 'operator' => '==',
66 + 'value' => 'ui-e-animation-rm-show',
67 + ],
68 + ],
69 + ],
69 70 ]
70 71 ];
71 72 }
72 - protected function register_controls()
73 - {
73 + public function has_widget_inner_wrapper(): bool
74 + {
75 + // TODO: remove after Optmized Markup experiment is merged to the core
76 + return ! \Elementor\Plugin::$instance->experiments->is_feature_active('e_optimized_markup');
77 + }
78 + protected function register_controls()
79 + {
74 80
75 - $this->start_controls_section(
76 - 'section_content_icon_box',
77 - [
78 - 'label' => esc_html__('Icon Box', 'uicore-elements'),
79 - ]
80 - );
81 + $this->start_controls_section(
82 + 'section_content_icon_box',
83 + [
84 + 'label' => esc_html__('Icon Box', 'uicore-elements'),
85 + ]
86 + );
81 87
82 - $this->add_control(
83 - 'icon_type',
84 - [
85 - 'label' => esc_html__('Icon Type', 'uicore-elements'),
86 - 'type' => Controls_Manager::CHOOSE,
87 - 'toggle' => false,
88 - 'default' => 'icon',
89 - 'render_type' => 'template',
90 - 'options' => [
91 - 'none' => [
92 - 'title' => esc_html__('None', 'uicore-elements'),
93 - 'icon' => 'eicon-editor-close'
94 - ],
95 - 'icon' => [
96 - 'title' => esc_html__('Icon', 'uicore-elements'),
97 - 'icon' => 'fas fa-star'
98 - ],
99 - 'image' => [
100 - 'title' => esc_html__('Image', 'uicore-elements'),
101 - 'icon' => 'far fa-image'
102 - ]
103 - ]
104 - ]
105 - );
88 + $this->add_control(
89 + 'icon_type',
90 + [
91 + 'label' => esc_html__('Icon Type', 'uicore-elements'),
92 + 'type' => Controls_Manager::CHOOSE,
93 + 'toggle' => false,
94 + 'default' => 'icon',
95 + 'render_type' => 'template',
96 + 'options' => [
97 + 'none' => [
98 + 'title' => esc_html__('None', 'uicore-elements'),
99 + 'icon' => 'eicon-editor-close'
100 + ],
101 + 'icon' => [
102 + 'title' => esc_html__('Icon', 'uicore-elements'),
103 + 'icon' => 'fas fa-star'
104 + ],
105 + 'image' => [
106 + 'title' => esc_html__('Image', 'uicore-elements'),
107 + 'icon' => 'far fa-image'
108 + ]
109 + ]
110 + ]
111 + );
106 112
107 - $this->add_control(
108 - 'selected_icon',
109 - [
110 - 'label' => esc_html__('Icon', 'uicore-elements'),
111 - 'type' => Controls_Manager::ICONS,
112 - 'default' => [
113 - 'value' => 'fas fa-star',
114 - 'library' => 'fa-solid',
115 - ],
116 - 'render_type' => 'template',
117 - 'condition' => [
118 - 'icon_type' => 'icon',
119 - ],
120 - ]
121 - );
113 + $this->add_control(
114 + 'selected_icon',
115 + [
116 + 'label' => esc_html__('Icon', 'uicore-elements'),
117 + 'type' => Controls_Manager::ICONS,
118 + 'default' => [
119 + 'value' => 'fas fa-star',
120 + 'library' => 'fa-solid',
121 + ],
122 + 'render_type' => 'template',
123 + 'condition' => [
124 + 'icon_type' => 'icon',
125 + ],
126 + ]
127 + );
122 128
123 - $this->add_control(
124 - 'image',
125 - [
126 - 'label' => esc_html__('Image Icon', 'uicore-elements'),
127 - 'type' => Controls_Manager::MEDIA,
128 - 'render_type' => 'template',
129 - 'default' => [
130 - 'url' => Utils::get_placeholder_image_src(),
131 - ],
132 - 'condition' => [
133 - 'icon_type' => 'image'
134 - ]
135 - ]
136 - );
129 + $this->add_control(
130 + 'image',
131 + [
132 + 'label' => esc_html__('Image Icon', 'uicore-elements'),
133 + 'type' => Controls_Manager::MEDIA,
134 + 'render_type' => 'template',
135 + 'default' => [
136 + 'url' => Utils::get_placeholder_image_src(),
137 + ],
138 + 'condition' => [
139 + 'icon_type' => 'image'
140 + ]
141 + ]
142 + );
137 143
138 - $this->add_control(
139 - 'title_text',
140 - [
141 - 'label' => esc_html__('Title', 'uicore-elements'),
142 - 'type' => Controls_Manager::TEXT,
143 - 'dynamic' => [
144 - 'active' => true,
145 - ],
146 - 'default' => esc_html__('Icon Box Title', 'uicore-elements'),
147 - 'placeholder' => esc_html__('Enter your title', 'uicore-elements'),
148 - 'label_block' => true,
149 - ]
150 - );
144 + $this->add_control(
145 + 'title_text',
146 + [
147 + 'label' => esc_html__('Title', 'uicore-elements'),
148 + 'type' => Controls_Manager::TEXT,
149 + 'dynamic' => [
150 + 'active' => true,
151 + ],
152 + 'default' => esc_html__('Icon Box Title', 'uicore-elements'),
153 + 'placeholder' => esc_html__('Enter your title', 'uicore-elements'),
154 + 'label_block' => true,
155 + ]
156 + );
151 157
152 - $this->add_control(
153 - 'title_link_url',
154 - [
155 - 'label' => esc_html__('Title Link URL', 'uicore-elements'),
156 - 'type' => Controls_Manager::URL,
157 - 'dynamic' => ['active' => true],
158 - ]
159 - );
158 + $this->add_control(
159 + 'title_link_url',
160 + [
161 + 'label' => esc_html__('Title Link URL', 'uicore-elements'),
162 + 'type' => Controls_Manager::URL,
163 + 'dynamic' => ['active' => true],
164 + ]
165 + );
160 166
161 - $this->add_control(
162 - 'sub_title_text',
163 - [
164 - 'label' => esc_html__('Subtitle', 'uicore-elements'),
165 - 'type' => Controls_Manager::TEXT,
166 - 'dynamic' => [
167 - 'active' => true,
168 - ],
169 - 'default' => esc_html__('Icon Box Subtitle', 'uicore-elements'),
170 - 'placeholder' => esc_html__('Enter your sub title', 'uicore-elements'),
171 - 'label_block' => true,
172 - ]
173 - );
167 + $this->add_control(
168 + 'sub_title_text',
169 + [
170 + 'label' => esc_html__('Subtitle', 'uicore-elements'),
171 + 'type' => Controls_Manager::TEXT,
172 + 'dynamic' => [
173 + 'active' => true,
174 + ],
175 + 'default' => esc_html__('Icon Box Subtitle', 'uicore-elements'),
176 + 'placeholder' => esc_html__('Enter your sub title', 'uicore-elements'),
177 + 'label_block' => true,
178 + ]
179 + );
174 180
175 - $this->add_control(
176 - 'description_text',
177 - [
178 - 'label' => esc_html__('Description', 'uicore-elements'),
179 - 'type' => Controls_Manager::WYSIWYG,
180 - 'dynamic' => [
181 - 'active' => true,
182 - ],
183 - 'default' => esc_html__("This serves as the explanatory text for the icon box. Use it to provide additional context or details that elaborate on the title's content.", "uicore-elements"),
184 - 'placeholder' => esc_html__('Enter your description', 'uicore-elements'),
185 - 'rows' => 10,
186 - ]
187 - );
181 + $this->add_control(
182 + 'description_text',
183 + [
184 + 'label' => esc_html__('Description', 'uicore-elements'),
185 + 'type' => Controls_Manager::WYSIWYG,
186 + 'dynamic' => [
187 + 'active' => true,
188 + ],
189 + 'default' => esc_html__("This serves as the explanatory text for the icon box. Use it to provide additional context or details that elaborate on the title's content.", "uicore-elements"),
190 + 'placeholder' => esc_html__('Enter your description', 'uicore-elements'),
191 + 'rows' => 10,
192 + ]
193 + );
188 194
189 - $this->add_control(
190 - 'position',
191 - [
192 - 'label' => esc_html__('Icon Position', 'uicore-elements'),
193 - 'type' => Controls_Manager::CHOOSE,
194 - 'separator' => 'before',
195 - 'default' => 'top',
196 - 'options' => [
197 - 'left' => [
198 - 'title' => esc_html__('Left', 'uicore-elements'),
199 - 'icon' => 'eicon-h-align-left',
200 - ],
201 - 'top' => [
202 - 'title' => esc_html__('Top', 'uicore-elements'),
203 - 'icon' => 'eicon-v-align-top',
204 - ],
205 - 'right' => [
206 - 'title' => esc_html__('Right', 'uicore-elements'),
207 - 'icon' => 'eicon-h-align-right',
208 - ],
209 - 'bottom' => [
210 - 'title' => esc_html__('Bottom', 'uicore-elements'),
211 - 'icon' => 'eicon-v-align-bottom',
212 - ],
213 - ],
214 - 'frontend_available' => true,
215 - 'prefix_class' => 'ui-e-',
216 - 'toggle' => false,
217 - 'render_type' => 'template',
218 - 'conditions' => [
219 - 'relation' => 'or',
220 - 'terms' => [
221 - [
222 - 'name' => 'selected_icon[value]',
223 - 'operator' => '!=',
224 - 'value' => ''
225 - ],
226 - [
227 - 'name' => 'image[url]',
228 - 'operator' => '!=',
229 - 'value' => ''
230 - ],
231 - ]
232 - ]
233 - ]
234 - );
195 + $this->add_control(
196 + 'position',
197 + [
198 + 'label' => esc_html__('Icon Position', 'uicore-elements'),
199 + 'type' => Controls_Manager::CHOOSE,
200 + 'separator' => 'before',
201 + 'default' => 'top',
202 + 'options' => [
203 + 'left' => [
204 + 'title' => esc_html__('Left', 'uicore-elements'),
205 + 'icon' => 'eicon-h-align-left',
206 + ],
207 + 'top' => [
208 + 'title' => esc_html__('Top', 'uicore-elements'),
209 + 'icon' => 'eicon-v-align-top',
210 + ],
211 + 'right' => [
212 + 'title' => esc_html__('Right', 'uicore-elements'),
213 + 'icon' => 'eicon-h-align-right',
214 + ],
215 + 'bottom' => [
216 + 'title' => esc_html__('Bottom', 'uicore-elements'),
217 + 'icon' => 'eicon-v-align-bottom',
218 + ],
219 + ],
220 + 'frontend_available' => true,
221 + 'prefix_class' => 'ui-e-',
222 + 'toggle' => false,
223 + 'render_type' => 'template',
224 + 'conditions' => [
225 + 'relation' => 'or',
226 + 'terms' => [
227 + [
228 + 'name' => 'selected_icon[value]',
229 + 'operator' => '!=',
230 + 'value' => ''
231 + ],
232 + [
233 + 'name' => 'image[url]',
234 + 'operator' => '!=',
235 + 'value' => ''
236 + ],
237 + ]
238 + ]
239 + ]
240 + );
235 241
236 - $this->add_control(
237 - 'icon_inline',
238 - [
239 - 'label' => esc_html__('Icon Inline', 'uicore-elements'),
240 - 'type' => Controls_Manager::SWITCHER,
241 - 'prefix_class' => 'ui-e-inline-',
242 - 'render_type' => 'template',
243 - 'frontend_available' => true,
244 - 'condition' => [
245 - 'position' => ['left', 'right']
246 - ],
247 - ]
248 - );
242 + $this->add_control(
243 + 'icon_inline',
244 + [
245 + 'label' => esc_html__('Icon Inline', 'uicore-elements'),
246 + 'type' => Controls_Manager::SWITCHER,
247 + 'prefix_class' => 'ui-e-inline-',
248 + 'render_type' => 'template',
249 + 'frontend_available' => true,
250 + 'condition' => [
251 + 'position' => ['left', 'right']
252 + ],
253 + ]
254 + );
249 255
250 - $this->add_responsive_control(
251 - 'icon_vertical_alignment',
252 - [
253 - 'label' => esc_html__('Icon Vertical Alignment', 'uicore-elements'),
254 - 'type' => Controls_Manager::CHOOSE,
255 - 'options' => [
256 - 'start' => [
257 - 'title' => esc_html__('Top', 'uicore-elements'),
258 - 'icon' => 'eicon-v-align-top',
259 - ],
260 - 'center' => [
261 - 'title' => esc_html__('Middle', 'uicore-elements'),
262 - 'icon' => 'eicon-v-align-middle',
263 - ],
264 - 'end' => [
265 - 'title' => esc_html__('Bottom', 'uicore-elements'),
266 - 'icon' => 'eicon-v-align-bottom',
267 - ],
268 - ],
269 - 'default' => 'start',
270 - 'toggle' => false,
271 - 'selectors' => [
272 - '{{WRAPPER}} .ui-e-flex-wrp' => 'align-items: {{VALUE}};',
273 - ],
274 - 'condition' => [
275 - 'position' => ['left', 'right'],
276 - 'icon_inline' => '',
277 - ],
278 - ]
279 - );
256 + $this->add_control(
257 + 'icon_mobile',
258 + [
259 + 'label' => esc_html__('Icon Top on Mobile', 'uicore-elements'),
260 + 'type' => Controls_Manager::SWITCHER,
261 + 'prefix_class' => 'ui-e-mobile-',
262 + 'condition' => [
263 + 'position' => ['left', 'right'],
264 + 'icon_inline' => ''
265 + ],
266 + ]
267 + );
280 268
281 - $this->add_responsive_control(
282 - 'text_align',
283 - [
284 - 'label' => esc_html__('Alignment', 'uicore-elements'),
285 - 'type' => Controls_Manager::CHOOSE,
286 - 'options' => [
287 - 'left' => [
288 - 'title' => esc_html__('Left', 'uicore-elements'),
289 - 'icon' => 'eicon-text-align-left',
290 - ],
291 - 'center' => [
292 - 'title' => esc_html__('Center', 'uicore-elements'),
293 - 'icon' => 'eicon-text-align-center',
294 - ],
295 - 'right' => [
296 - 'title' => esc_html__('Right', 'uicore-elements'),
297 - 'icon' => 'eicon-text-align-right',
298 - ],
299 - 'justify' => [
300 - 'title' => esc_html__('Justified', 'uicore-elements'),
301 - 'icon' => 'eicon-text-align-justify',
302 - ],
303 - ],
304 - 'default' => 'center',
305 - 'tablet_default' => 'center',
306 - 'mobile_default' => 'center',
307 - 'toggle' => false,
308 - 'prefix_class' => 'ui-e-align%s-',
309 - 'selectors' => [
310 - '{{WRAPPER}}' => '--ui-e-ico-box-text-align: {{VALUE}};',
311 - ],
312 - ]
313 - );
269 + $this->add_responsive_control(
270 + 'icon_vertical_alignment',
271 + [
272 + 'label' => esc_html__('Icon Vertical Alignment', 'uicore-elements'),
273 + 'type' => Controls_Manager::CHOOSE,
274 + 'options' => [
275 + 'start' => [
276 + 'title' => esc_html__('Top', 'uicore-elements'),
277 + 'icon' => 'eicon-v-align-top',
278 + ],
279 + 'center' => [
280 + 'title' => esc_html__('Middle', 'uicore-elements'),
281 + 'icon' => 'eicon-v-align-middle',
282 + ],
283 + 'end' => [
284 + 'title' => esc_html__('Bottom', 'uicore-elements'),
285 + 'icon' => 'eicon-v-align-bottom',
286 + ],
287 + ],
288 + 'default' => 'start',
289 + 'toggle' => false,
290 + 'selectors' => [
291 + '{{WRAPPER}} .ui-e-flex-wrp' => 'align-items: {{VALUE}};',
292 + ],
293 + 'condition' => [
294 + 'position' => ['left', 'right'],
295 + 'icon_inline' => '',
296 + ],
297 + ]
298 + );
314 299
315 - // Responsible for using 'text_align' value as css property instead of css value on the readmore, if animated and left/right positioned without inline.
316 - // In this case, the readmore with show animation is absolute with margin:auto, text-align stops working.
317 - $this->add_control(
318 - 'text_align_readmore',
319 - [
320 - 'label' => esc_html__( 'Readmore Animation Alignment', 'uicore-elements' ),
321 - 'type' => \Elementor\Controls_Manager::HIDDEN,
322 - 'default' => '0',
323 - 'condition' => [
324 - 'text_align' => ['left', 'right'],
325 - 'icon_inline' => '',
326 - 'readmore_animation' => 'ui-e-animation-rm-show',
327 - ],
328 - 'selectors' => [
329 - '{{WRAPPER}} .ui-e-readmore' => 'margin-{{text_align.VALUE}}: {{VALUE}} !important;',
330 - ],
331 - ]
332 - );
300 + $this->add_responsive_control(
301 + 'text_align',
302 + [
303 + 'label' => esc_html__('Alignment', 'uicore-elements'),
304 + 'type' => Controls_Manager::CHOOSE,
305 + 'options' => [
306 + 'left' => [
307 + 'title' => esc_html__('Left', 'uicore-elements'),
308 + 'icon' => 'eicon-text-align-left',
309 + ],
310 + 'center' => [
311 + 'title' => esc_html__('Center', 'uicore-elements'),
312 + 'icon' => 'eicon-text-align-center',
313 + ],
314 + 'right' => [
315 + 'title' => esc_html__('Right', 'uicore-elements'),
316 + 'icon' => 'eicon-text-align-right',
317 + ],
318 + 'justify' => [
319 + 'title' => esc_html__('Justified', 'uicore-elements'),
320 + 'icon' => 'eicon-text-align-justify',
321 + ],
322 + ],
323 + 'default' => 'center',
324 + 'tablet_default' => 'center',
325 + 'mobile_default' => 'center',
326 + 'toggle' => false,
327 + 'prefix_class' => 'ui-e-align%s-',
328 + 'selectors' => [
329 + '{{WRAPPER}}' => '--ui-e-ico-box-text-align: {{VALUE}};',
330 + ],
331 + ]
332 + );
333 333
334 - $this->end_controls_section();
334 + // Responsible for using 'text_align' value as css property instead of css value on the readmore, if animated and left/right positioned without inline.
335 + // In this case, the readmore with show animation is absolute with margin:auto, text-align stops working.
336 + $this->add_control(
337 + 'text_align_readmore',
338 + [
339 + 'label' => esc_html__('Readmore Animation Alignment', 'uicore-elements'),
340 + 'type' => \Elementor\Controls_Manager::HIDDEN,
341 + 'default' => '0',
342 + 'condition' => [
343 + 'text_align' => ['left', 'right'],
344 + 'icon_inline' => '',
345 + 'readmore_animation' => 'ui-e-animation-rm-show',
346 + ],
347 + 'selectors' => [
348 + '{{WRAPPER}} .ui-e-readmore' => 'margin-{{text_align.VALUE}}: {{VALUE}} !important;',
349 + ],
350 + ]
351 + );
335 352
336 - $this->start_controls_section(
337 - 'section_content_readmore',
338 - [
339 - 'label' => esc_html__('Read More', 'uicore-elements'),
340 - 'condition' => [
341 - 'readmore' => 'yes',
342 - ],
343 - ]
344 - );
353 + $this->end_controls_section();
345 354
346 - $this->add_control(
347 - 'readmore_text',
348 - [
349 - 'label' => esc_html__('Text', 'uicore-elements'),
350 - 'type' => Controls_Manager::TEXT,
351 - 'dynamic' => ['active' => true],
352 - 'default' => esc_html__('Read More', 'uicore-elements'),
353 - 'placeholder' => esc_html__('Read More', 'uicore-elements'),
354 - ]
355 - );
355 + $this->start_controls_section(
356 + 'section_content_readmore',
357 + [
358 + 'label' => esc_html__('Read More', 'uicore-elements'),
359 + 'condition' => [
360 + 'readmore' => 'yes',
361 + ],
362 + ]
363 + );
356 364
357 - $this->add_control(
358 - 'readmore_link',
359 - [
360 - 'label' => esc_html__('Link to', 'uicore-elements'),
361 - 'type' => Controls_Manager::URL,
362 - 'dynamic' => [
363 - 'active' => true,
364 - ],
365 - 'placeholder' => esc_html__('https://your-link.com', 'uicore-elements'),
366 - 'default' => [
367 - 'url' => '#',
368 - ],
369 - 'condition' => [
370 - 'readmore' => 'yes',
371 - ]
372 - ]
373 - );
365 + $this->add_control(
366 + 'readmore_text',
367 + [
368 + 'label' => esc_html__('Text', 'uicore-elements'),
369 + 'type' => Controls_Manager::TEXT,
370 + 'dynamic' => ['active' => true],
371 + 'default' => esc_html__('Read More', 'uicore-elements'),
372 + 'placeholder' => esc_html__('Read More', 'uicore-elements'),
373 + ]
374 + );
374 375
376 + $this->add_control(
377 + 'readmore_link',
378 + [
379 + 'label' => esc_html__('Link to', 'uicore-elements'),
380 + 'type' => Controls_Manager::URL,
381 + 'dynamic' => [
382 + 'active' => true,
383 + ],
384 + 'placeholder' => esc_html__('https://your-link.com', 'uicore-elements'),
385 + 'default' => [
386 + 'url' => '#',
387 + ],
388 + 'condition' => [
389 + 'readmore' => 'yes',
390 + ]
391 + ]
392 + );
393 +
375 394 // TODO: disabled due to a security complain from Wordfence team in name of Wordpress.
376 - // $this->add_control(
377 - // 'onclick',
378 - // [
379 - // 'label' => esc_html__('OnClick', 'uicore-elements'),
380 - // 'type' => Controls_Manager::SWITCHER,
381 - // 'condition' => [
382 - // 'readmore' => 'yes',
383 - // ]
384 - // ]
385 - // );
395 + // $this->add_control(
396 + // 'onclick',
397 + // [
398 + // 'label' => esc_html__('OnClick', 'uicore-elements'),
399 + // 'type' => Controls_Manager::SWITCHER,
400 + // 'condition' => [
401 + // 'readmore' => 'yes',
402 + // ]
403 + // ]
404 + // );
386 405
387 - // $this->add_control(
388 - // 'onclick_event',
389 - // [
390 - // 'label' => esc_html__('OnClick Event', 'uicore-elements'),
391 - // 'type' => Controls_Manager::TEXT,
392 - // 'placeholder' => 'myFunction()',
393 - // 'condition' => [
394 - // 'readmore' => 'yes',
395 - // 'onclick' => 'yes'
396 - // ]
397 - // ]
398 - // );
406 + // $this->add_control(
407 + // 'onclick_event',
408 + // [
409 + // 'label' => esc_html__('OnClick Event', 'uicore-elements'),
410 + // 'type' => Controls_Manager::TEXT,
411 + // 'placeholder' => 'myFunction()',
412 + // 'condition' => [
413 + // 'readmore' => 'yes',
414 + // 'onclick' => 'yes'
415 + // ]
416 + // ]
417 + // );
399 418
400 - $this->add_control(
401 - 'readmore_icon',
402 - [
403 - 'label' => esc_html__('Icon', 'uicore-elements'),
404 - 'type' => Controls_Manager::ICONS,
405 - 'condition' => [
406 - 'readmore' => 'yes'
407 - ],
408 - 'label_block' => false,
409 - 'skin' => 'inline'
410 - ]
411 - );
419 + $this->add_control(
420 + 'readmore_icon',
421 + [
422 + 'label' => esc_html__('Icon', 'uicore-elements'),
423 + 'type' => Controls_Manager::ICONS,
424 + 'condition' => [
425 + 'readmore' => 'yes'
426 + ],
427 + 'label_block' => false,
428 + 'skin' => 'inline'
429 + ]
430 + );
412 431
413 - $this->add_control(
414 - 'readmore_icon_align',
415 - [
416 - 'label' => esc_html__('Icon Position', 'uicore-elements'),
417 - 'type' => Controls_Manager::SELECT,
418 - 'default' => 'right',
419 - 'options' => [
420 - 'left' => esc_html__('Left', 'uicore-elements'),
421 - 'right' => esc_html__('Right', 'uicore-elements'),
422 - ],
432 + $this->add_control(
433 + 'readmore_icon_align',
434 + [
435 + 'label' => esc_html__('Icon Position', 'uicore-elements'),
436 + 'type' => Controls_Manager::SELECT,
437 + 'default' => 'right',
438 + 'options' => [
439 + 'left' => esc_html__('Left', 'uicore-elements'),
440 + 'right' => esc_html__('Right', 'uicore-elements'),
441 + ],
423 442 'selectors_dictionary' => [
424 443 'left' => 'flex-direction: row-reverse;',
425 444 'right' => 'flex-direction: row;',
426 445 ],
@@ -426,1629 +445,1630 @@
426 445 ],
427 446 'selectors' => [
428 447 '{{WRAPPER}} .ui-e-readmore' => '{{VALUE}};',
429 448 ],
430 - 'condition' => [
431 - 'readmore_icon[value]!' => '',
432 - ],
433 - ]
434 - );
449 + 'condition' => [
450 + 'readmore_icon[value]!' => '',
451 + ],
452 + ]
453 + );
435 454
436 - $this->add_control(
437 - 'readmore_icon_indent',
438 - [
439 - 'label' => esc_html__('Icon Spacing', 'uicore-elements'),
440 - 'type' => Controls_Manager::SLIDER,
441 - 'range' => [
442 - 'px' => [
443 - 'max' => 100,
444 - ],
445 - ],
446 - 'default' => [
447 - 'size' => 8,
448 - ],
449 - 'condition' => [
450 - 'readmore_icon[value]!' => '',
451 - 'readmore_text!' => '',
455 + $this->add_control(
456 + 'readmore_icon_indent',
457 + [
458 + 'label' => esc_html__('Icon Spacing', 'uicore-elements'),
459 + 'type' => Controls_Manager::SLIDER,
460 + 'range' => [
461 + 'px' => [
462 + 'max' => 100,
463 + ],
464 + ],
465 + 'default' => [
466 + 'size' => 8,
467 + ],
468 + 'condition' => [
469 + 'readmore_icon[value]!' => '',
470 + 'readmore_text!' => '',
452 471 'text_align!' => 'justify'
453 - ],
454 - 'selectors' => [
455 - '{{WRAPPER}} .ui-e-readmore' => 'gap: {{SIZE}}px;',
456 - ],
457 - ]
458 - );
472 + ],
473 + 'selectors' => [
474 + '{{WRAPPER}} .ui-e-readmore' => 'gap: {{SIZE}}px;',
475 + ],
476 + ]
477 + );
459 478
460 - $this->add_responsive_control(
461 - 'readmore_horizontal_offset',
462 - [
463 - 'label' => esc_html__('Horizontal Offset', 'uicore-elements'),
464 - 'type' => Controls_Manager::SLIDER,
465 - 'default' => [
466 - 'size' => 0,
467 - ],
468 - 'tablet_default' => [
469 - 'size' => 0,
470 - ],
471 - 'mobile_default' => [
472 - 'size' => 0,
473 - ],
474 - 'range' => [
475 - 'px' => [
476 - 'min' => -200,
477 - 'max' => 200,
478 - ],
479 - ],
480 - 'condition' => [
481 - 'readmore_on_hover' => 'yes',
482 - ],
483 - ]
484 - );
479 + $this->add_responsive_control(
480 + 'readmore_horizontal_offset',
481 + [
482 + 'label' => esc_html__('Horizontal Offset', 'uicore-elements'),
483 + 'type' => Controls_Manager::SLIDER,
484 + 'default' => [
485 + 'size' => 0,
486 + ],
487 + 'tablet_default' => [
488 + 'size' => 0,
489 + ],
490 + 'mobile_default' => [
491 + 'size' => 0,
492 + ],
493 + 'range' => [
494 + 'px' => [
495 + 'min' => -200,
496 + 'max' => 200,
497 + ],
498 + ],
499 + 'condition' => [
500 + 'readmore_on_hover' => 'yes',
501 + ],
502 + ]
503 + );
485 504
486 - $this->add_responsive_control(
487 - 'readmore_vertical_offset',
488 - [
489 - 'label' => esc_html__('Vertical Offset', 'uicore-elements'),
490 - 'type' => Controls_Manager::SLIDER,
491 - 'default' => [
492 - 'size' => 0,
493 - ],
494 - 'tablet_default' => [
495 - 'size' => 0,
496 - ],
497 - 'mobile_default' => [
498 - 'size' => 0,
499 - ],
500 - 'range' => [
501 - 'px' => [
502 - 'min' => -200,
503 - 'max' => 200,
504 - ],
505 - ],
506 - 'selectors' => [
507 - '{{WRAPPER}} .ui-e-readmore' => 'translate: {{readmore_horizontal_offset.SIZE}}px {{SIZE}}px;'
508 - ],
509 - 'condition' => [
510 - 'readmore_on_hover' => 'yes',
511 - ],
512 - ]
513 - );
505 + $this->add_responsive_control(
506 + 'readmore_vertical_offset',
507 + [
508 + 'label' => esc_html__('Vertical Offset', 'uicore-elements'),
509 + 'type' => Controls_Manager::SLIDER,
510 + 'default' => [
511 + 'size' => 0,
512 + ],
513 + 'tablet_default' => [
514 + 'size' => 0,
515 + ],
516 + 'mobile_default' => [
517 + 'size' => 0,
518 + ],
519 + 'range' => [
520 + 'px' => [
521 + 'min' => -200,
522 + 'max' => 200,
523 + ],
524 + ],
525 + 'selectors' => [
526 + '{{WRAPPER}} .ui-e-readmore' => 'translate: {{readmore_horizontal_offset.SIZE}}px {{SIZE}}px;'
527 + ],
528 + 'condition' => [
529 + 'readmore_on_hover' => 'yes',
530 + ],
531 + ]
532 + );
514 533
515 - $this->add_control(
516 - 'button_css_id',
517 - [
518 - 'label' => esc_html__('Button ID', 'uicore-elements'),
519 - 'type' => Controls_Manager::TEXT,
520 - 'dynamic' => [
521 - 'active' => true,
522 - ],
523 - 'default' => '',
524 - 'title' => esc_html__('Add your custom id WITHOUT hash (#) key. e.g: my-id', 'uicore-elements'),
525 - 'separator' => 'before',
526 - ]
527 - );
534 + $this->add_control(
535 + 'button_css_id',
536 + [
537 + 'label' => esc_html__('Button ID', 'uicore-elements'),
538 + 'type' => Controls_Manager::TEXT,
539 + 'dynamic' => [
540 + 'active' => true,
541 + ],
542 + 'default' => '',
543 + 'title' => esc_html__('Add your custom id WITHOUT hash (#) key. e.g: my-id', 'uicore-elements'),
544 + 'separator' => 'before',
545 + ]
546 + );
528 547
529 - $this->end_controls_section();
548 + $this->end_controls_section();
530 549
531 - $this->start_controls_section(
532 - 'section_content_badge',
533 - [
534 - 'label' => esc_html__('Badge', 'uicore-elements'),
535 - 'condition' => [
536 - 'badge' => 'yes',
537 - ],
538 - ]
539 - );
550 + $this->start_controls_section(
551 + 'section_content_badge',
552 + [
553 + 'label' => esc_html__('Badge', 'uicore-elements'),
554 + 'condition' => [
555 + 'badge' => 'yes',
556 + ],
557 + ]
558 + );
540 559
541 - $this->add_control(
542 - 'badge_text',
543 - [
544 - 'label' => esc_html__('Badge Text', 'uicore-elements'),
545 - 'type' => Controls_Manager::TEXT,
546 - 'default' => 'POPULAR',
547 - 'placeholder' => 'Type Badge Title',
548 - 'dynamic' => [
549 - 'active' => true,
550 - ],
551 - ]
552 - );
560 + $this->add_control(
561 + 'badge_text',
562 + [
563 + 'label' => esc_html__('Badge Text', 'uicore-elements'),
564 + 'type' => Controls_Manager::TEXT,
565 + 'default' => 'POPULAR',
566 + 'placeholder' => 'Type Badge Title',
567 + 'dynamic' => [
568 + 'active' => true,
569 + ],
570 + ]
571 + );
553 572
554 - $this->end_controls_section();
573 + $this->end_controls_section();
555 574
556 - $this->start_controls_section(
557 - 'section_content_additional',
558 - [
559 - 'label' => esc_html__('Additional Options', 'uicore-elements'),
560 - ]
561 - );
575 + $this->start_controls_section(
576 + 'section_content_additional',
577 + [
578 + 'label' => esc_html__('Additional Options', 'uicore-elements'),
579 + ]
580 + );
562 581
563 - $this->add_control(
564 - 'title_size',
565 - [
566 - 'label' => esc_html__('Title HTML Tag', 'uicore-elements'),
567 - 'type' => Controls_Manager::SELECT,
568 - 'default' => 'h4',
569 - 'options' => Helper::get_title_tags(),
570 - ]
571 - );
582 + $this->add_control(
583 + 'title_size',
584 + [
585 + 'label' => esc_html__('Title HTML Tag', 'uicore-elements'),
586 + 'type' => Controls_Manager::SELECT,
587 + 'default' => 'h4',
588 + 'options' => Helper::get_title_tags(),
589 + ]
590 + );
572 591
573 - $this->add_control(
574 - 'readmore',
575 - [
576 - 'label' => esc_html__('Read More Button', 'uicore-elements'),
577 - 'type' => Controls_Manager::SWITCHER,
578 - 'separator' => 'before',
579 - 'frontend_available' => true,
580 - 'default' => 'yes',
581 - ]
582 - );
592 + $this->add_control(
593 + 'readmore',
594 + [
595 + 'label' => esc_html__('Read More Button', 'uicore-elements'),
596 + 'type' => Controls_Manager::SWITCHER,
597 + 'separator' => 'before',
598 + 'frontend_available' => true,
599 + 'default' => 'yes',
600 + ]
601 + );
583 602
584 - $this->add_control(
585 - 'badge',
586 - [
587 - 'label' => esc_html__('Badge', 'uicore-elements'),
588 - 'type' => Controls_Manager::SWITCHER,
589 - ]
590 - );
603 + $this->add_control(
604 + 'badge',
605 + [
606 + 'label' => esc_html__('Badge', 'uicore-elements'),
607 + 'type' => Controls_Manager::SWITCHER,
608 + ]
609 + );
591 610
592 - $this->add_control(
593 - 'global_link',
594 - [
595 - 'label' => esc_html__('Global Link', 'uicore-elements'),
596 - 'type' => Controls_Manager::SWITCHER,
597 - ]
598 - );
611 + $this->add_control(
612 + 'global_link',
613 + [
614 + 'label' => esc_html__('Global Link', 'uicore-elements'),
615 + 'type' => Controls_Manager::SWITCHER,
616 + ]
617 + );
599 618
600 - $this->add_control(
601 - 'global_link_url',
602 - [
603 - 'label' => esc_html__('Global Link URL', 'uicore-elements'),
604 - 'type' => Controls_Manager::URL,
605 - 'dynamic' => ['active' => true],
606 - 'placeholder' => 'http://your-link.com',
607 - 'condition' => [
608 - 'global_link' => 'yes'
609 - ]
610 - ]
611 - );
619 + $this->add_control(
620 + 'global_link_url',
621 + [
622 + 'label' => esc_html__('Global Link URL', 'uicore-elements'),
623 + 'type' => Controls_Manager::URL,
624 + 'dynamic' => ['active' => true],
625 + 'placeholder' => 'http://your-link.com',
626 + 'condition' => [
627 + 'global_link' => 'yes'
628 + ]
629 + ]
630 + );
612 631
613 - $this->end_controls_section();
632 + $this->end_controls_section();
614 633
615 - $this->start_controls_section(
616 - 'section_style_icon_box',
617 - [
618 - 'label' => esc_html__('Icon/Image', 'uicore-elements'),
619 - 'tab' => Controls_Manager::TAB_STYLE,
620 - 'condition' => [
621 - 'icon_type!' => 'none',
622 - ],
623 - ]
624 - );
634 + $this->start_controls_section(
635 + 'section_style_icon_box',
636 + [
637 + 'label' => esc_html__('Icon/Image', 'uicore-elements'),
638 + 'tab' => Controls_Manager::TAB_STYLE,
639 + 'condition' => [
640 + 'icon_type!' => 'none',
641 + ],
642 + ]
643 + );
625 644
626 - $this->start_controls_tabs('icon_colors');
645 + $this->start_controls_tabs('icon_colors');
627 646
628 - $this->start_controls_tab(
629 - 'icon_colors_normal',
630 - [
631 - 'label' => esc_html__('Normal', 'uicore-elements'),
632 - ]
633 - );
647 + $this->start_controls_tab(
648 + 'icon_colors_normal',
649 + [
650 + 'label' => esc_html__('Normal', 'uicore-elements'),
651 + ]
652 + );
634 653
635 - $this->add_control(
636 - 'icon_color',
637 - [
638 - 'label' => esc_html__('Icon Color', 'uicore-elements'),
639 - 'type' => Controls_Manager::COLOR,
640 - 'selectors' => [
641 - '{{WRAPPER}} .ui-e-icon-wrp i' => 'color: {{VALUE}};',
642 - '{{WRAPPER}} .ui-e-icon-wrp svg' => 'fill: {{VALUE}};',
643 - ],
644 - 'condition' => [
645 - 'icon_type!' => 'image',
646 - ],
647 - ]
648 - );
654 + $this->add_control(
655 + 'icon_color',
656 + [
657 + 'label' => esc_html__('Icon Color', 'uicore-elements'),
658 + 'type' => Controls_Manager::COLOR,
659 + 'selectors' => [
660 + '{{WRAPPER}} .ui-e-icon-wrp i' => 'color: {{VALUE}};',
661 + '{{WRAPPER}} .ui-e-icon-wrp svg' => 'fill: {{VALUE}};',
662 + ],
663 + 'condition' => [
664 + 'icon_type!' => 'image',
665 + ],
666 + ]
667 + );
649 668
650 - $this->add_control(
651 - 'show_svg_icon_color',
652 - [
653 - 'label' => esc_html__('Svg Icon Color', 'uicore-elements'),
654 - 'type' => Controls_Manager::SWITCHER,
655 - 'condition' => [
656 - 'icon_type!' => 'image',
657 - ],
658 - ]
659 - );
669 + $this->add_control(
670 + 'show_svg_icon_color',
671 + [
672 + 'label' => esc_html__('Svg Icon Color', 'uicore-elements'),
673 + 'type' => Controls_Manager::SWITCHER,
674 + 'condition' => [
675 + 'icon_type!' => 'image',
676 + ],
677 + ]
678 + );
660 679
661 - $this->add_control(
662 - 'svg_icon_fill_color',
663 - [
664 - 'label' => esc_html__('Fill Color', 'uicore-elements'),
665 - 'type' => Controls_Manager::COLOR,
666 - 'selectors' => [
667 - '{{WRAPPER}} .ui-e-icon-wrp svg, {{WRAPPER}} .ui-e-icon-wrp svg *' => 'fill: {{VALUE}};',
668 - ],
669 - 'condition' => [
670 - 'icon_type!' => 'image',
671 - 'show_svg_icon_color' => 'yes',
672 - ],
673 - ]
674 - );
680 + $this->add_control(
681 + 'svg_icon_fill_color',
682 + [
683 + 'label' => esc_html__('Fill Color', 'uicore-elements'),
684 + 'type' => Controls_Manager::COLOR,
685 + 'selectors' => [
686 + '{{WRAPPER}} .ui-e-icon-wrp svg, {{WRAPPER}} .ui-e-icon-wrp svg *' => 'fill: {{VALUE}};',
687 + ],
688 + 'condition' => [
689 + 'icon_type!' => 'image',
690 + 'show_svg_icon_color' => 'yes',
691 + ],
692 + ]
693 + );
675 694
676 - $this->add_control(
677 - 'svg_icon_stroke_color',
678 - [
679 - 'label' => esc_html__('Stroke Color', 'uicore-elements'),
680 - 'type' => Controls_Manager::COLOR,
681 - 'selectors' => [
682 - '{{WRAPPER}} .ui-e-icon-wrp svg, {{WRAPPER}} .ui-e-icon-wrp svg *' => 'stroke: {{VALUE}};',
683 - ],
684 - 'condition' => [
685 - 'icon_type!' => 'image',
686 - 'show_svg_icon_color' => 'yes',
687 - ],
688 - ]
689 - );
695 + $this->add_control(
696 + 'svg_icon_stroke_color',
697 + [
698 + 'label' => esc_html__('Stroke Color', 'uicore-elements'),
699 + 'type' => Controls_Manager::COLOR,
700 + 'selectors' => [
701 + '{{WRAPPER}} .ui-e-icon-wrp svg, {{WRAPPER}} .ui-e-icon-wrp svg *' => 'stroke: {{VALUE}};',
702 + ],
703 + 'condition' => [
704 + 'icon_type!' => 'image',
705 + 'show_svg_icon_color' => 'yes',
706 + ],
707 + ]
708 + );
690 709
691 - $this->add_control(
692 - 'blur_effect',
693 - [
694 - 'label' => esc_html__('Blur Filter', 'uicore-elements'),
695 - 'type' => Controls_Manager::SWITCHER,
696 - ]
697 - );
710 + $this->add_control(
711 + 'blur_effect',
712 + [
713 + 'label' => esc_html__('Blur Filter', 'uicore-elements'),
714 + 'type' => Controls_Manager::SWITCHER,
715 + ]
716 + );
698 717
699 - $this->add_control(
700 - 'blur_level',
701 - [
702 - 'label' => esc_html__('Blur Level', 'uicore-elements'),
703 - 'type' => Controls_Manager::SLIDER,
704 - 'range' => [
705 - 'px' => [
706 - 'min' => 0,
707 - 'step' => 1,
708 - 'max' => 50,
709 - ]
710 - ],
711 - 'default' => [
712 - 'size' => 5
713 - ],
714 - 'selectors' => [
715 - '{{WRAPPER}} .ui-e-icon-wrp' => 'backdrop-filter: blur({{SIZE}}px); -webkit-backdrop-filter: blur({{SIZE}}px);'
716 - ],
717 - 'condition' => [
718 - 'blur_effect' => 'yes',
719 - ]
720 - ]
721 - );
718 + $this->add_control(
719 + 'blur_level',
720 + [
721 + 'label' => esc_html__('Blur Level', 'uicore-elements'),
722 + 'type' => Controls_Manager::SLIDER,
723 + 'range' => [
724 + 'px' => [
725 + 'min' => 0,
726 + 'step' => 1,
727 + 'max' => 50,
728 + ]
729 + ],
730 + 'default' => [
731 + 'size' => 5
732 + ],
733 + 'selectors' => [
734 + '{{WRAPPER}} .ui-e-icon-wrp' => 'backdrop-filter: blur({{SIZE}}px); -webkit-backdrop-filter: blur({{SIZE}}px);'
735 + ],
736 + 'condition' => [
737 + 'blur_effect' => 'yes',
738 + ]
739 + ]
740 + );
722 741
723 - $this->add_group_control(
724 - Group_Control_Background::get_type(),
725 - [
726 - 'name' => 'icon_background',
727 - 'selector' => '{{WRAPPER}} .ui-e-icon-wrp',
728 - ]
729 - );
742 + $this->add_group_control(
743 + Group_Control_Background::get_type(),
744 + [
745 + 'name' => 'icon_background',
746 + 'selector' => '{{WRAPPER}} .ui-e-icon-wrp',
747 + ]
748 + );
730 749
731 - $this->add_group_control(
732 - Group_Control_Border::get_type(),
733 - [
734 - 'name' => 'icon_border',
735 - 'placeholder' => '1px',
736 - 'default' => '1px',
737 - 'selector' => '{{WRAPPER}} .ui-e-icon-wrp'
738 - ]
739 - );
750 + $this->add_group_control(
751 + Group_Control_Border::get_type(),
752 + [
753 + 'name' => 'icon_border',
754 + 'placeholder' => '1px',
755 + 'default' => '1px',
756 + 'selector' => '{{WRAPPER}} .ui-e-icon-wrp'
757 + ]
758 + );
740 759
741 - $this->add_responsive_control(
742 - 'icon_radius',
743 - [
744 - 'label' => esc_html__('Border Radius', 'uicore-elements'),
745 - 'type' => Controls_Manager::DIMENSIONS,
746 - 'size_units' => ['px', '%'],
747 - 'selectors' => [
748 - '{{WRAPPER}} .ui-e-icon-wrp' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
749 - ],
750 - 'condition' => [
751 - 'icon_radius_advanced_show!' => 'yes',
752 - ],
753 - ]
754 - );
760 + $this->add_responsive_control(
761 + 'icon_radius',
762 + [
763 + 'label' => esc_html__('Border Radius', 'uicore-elements'),
764 + 'type' => Controls_Manager::DIMENSIONS,
765 + 'size_units' => ['px', '%'],
766 + 'selectors' => [
767 + '{{WRAPPER}} .ui-e-icon-wrp' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
768 + ],
769 + 'condition' => [
770 + 'icon_radius_advanced_show!' => 'yes',
771 + ],
772 + ]
773 + );
755 774
756 - $this->add_control(
757 - 'icon_radius_advanced_show',
758 - [
759 - 'label' => esc_html__('Advanced Radius', 'uicore-elements'),
760 - 'type' => Controls_Manager::SWITCHER,''
761 - ]
762 - );
775 + $this->add_control(
776 + 'icon_radius_advanced_show',
777 + [
778 + 'label' => esc_html__('Advanced Radius', 'uicore-elements'),
779 + 'type' => Controls_Manager::SWITCHER,
780 + ''
781 + ]
782 + );
763 783
764 - $this->add_control(
765 - 'icon_radius_advanced',
766 - [
767 - 'label' => esc_html__('Radius', 'uicore-elements'),
768 - 'description' => sprintf('Generate the advanced border radius on https://9elements.github.io/fancy-border-radius/', 'uicore-elements'),
769 - 'type' => Controls_Manager::TEXT,
770 - 'size_units' => ['px', '%'],
771 - 'default' => '75% 25% 43% 57% / 46% 29% 71% 54%',
772 - 'selectors' => [
773 - '{{WRAPPER}} .ui-e-icon-wrp' => 'border-radius: {{VALUE}}; overflow: hidden;',
774 - '{{WRAPPER}} .ui-e-icon-wrp img' => 'border-radius: {{VALUE}}; overflow: hidden;'
775 - ],
776 - 'condition' => [
777 - 'icon_radius_advanced_show' => 'yes',
778 - ],
779 - ]
780 - );
784 + $this->add_control(
785 + 'icon_radius_advanced',
786 + [
787 + 'label' => esc_html__('Radius', 'uicore-elements'),
788 + 'description' => sprintf('Generate the advanced border radius on https://9elements.github.io/fancy-border-radius/', 'uicore-elements'),
789 + 'type' => Controls_Manager::TEXT,
790 + 'size_units' => ['px', '%'],
791 + 'default' => '75% 25% 43% 57% / 46% 29% 71% 54%',
792 + 'selectors' => [
793 + '{{WRAPPER}} .ui-e-icon-wrp' => 'border-radius: {{VALUE}}; overflow: hidden;',
794 + '{{WRAPPER}} .ui-e-icon-wrp img' => 'border-radius: {{VALUE}}; overflow: hidden;'
795 + ],
796 + 'condition' => [
797 + 'icon_radius_advanced_show' => 'yes',
798 + ],
799 + ]
800 + );
781 801
782 - $this->add_responsive_control(
783 - 'icon_padding',
784 - [
785 - 'label' => esc_html__('Padding', 'uicore-elements'),
786 - 'type' => Controls_Manager::DIMENSIONS,
787 - 'size_units' => ['px', 'em', '%'],
788 - 'default' => [
789 - 'top' => 10,
790 - 'right' => 10,
791 - 'bottom' => 10,
792 - 'left' => 10,
793 - 'unit' => 'px',
794 - 'isLinked' => true,
795 - ],
796 - 'selectors' => [
797 - '{{WRAPPER}} .ui-e-icon-wrp' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
798 - ]
799 - ]
800 - );
802 + $this->add_responsive_control(
803 + 'icon_padding',
804 + [
805 + 'label' => esc_html__('Padding', 'uicore-elements'),
806 + 'type' => Controls_Manager::DIMENSIONS,
807 + 'size_units' => ['px', 'em', '%'],
808 + 'default' => [
809 + 'top' => 10,
810 + 'right' => 10,
811 + 'bottom' => 10,
812 + 'left' => 10,
813 + 'unit' => 'px',
814 + 'isLinked' => true,
815 + ],
816 + 'selectors' => [
817 + '{{WRAPPER}} .ui-e-icon-wrp' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
818 + ]
819 + ]
820 + );
801 821
802 - $this->add_group_control(
803 - Group_Control_Box_Shadow::get_type(),
804 - [
805 - 'name' => 'icon_shadow',
806 - 'selector' => '{{WRAPPER}} .ui-e-icon-wrp'
807 - ]
808 - );
822 + $this->add_group_control(
823 + Group_Control_Box_Shadow::get_type(),
824 + [
825 + 'name' => 'icon_shadow',
826 + 'selector' => '{{WRAPPER}} .ui-e-icon-wrp'
827 + ]
828 + );
809 829
810 - $this->add_responsive_control(
811 - 'icon_space',
812 - [
813 - 'label' => esc_html__('Spacing', 'uicore-elements'),
814 - 'type' => Controls_Manager::SLIDER,
815 - 'separator' => 'before',
816 - 'default' => [
817 - 'size' => 15,
818 - ],
819 - 'range' => [
820 - 'px' => [
821 - 'min' => 0,
822 - 'max' => 100,
823 - ],
824 - ],
825 - 'selectors' => [
826 - '{{WRAPPER}}' => '--ui-e-ico-box-icon-spacing: {{SIZE}}{{UNIT}} !important;',
827 - ],
828 - ]
829 - );
830 + $this->add_responsive_control(
831 + 'icon_space',
832 + [
833 + 'label' => esc_html__('Spacing', 'uicore-elements'),
834 + 'type' => Controls_Manager::SLIDER,
835 + 'separator' => 'before',
836 + 'default' => [
837 + 'size' => 15,
838 + ],
839 + 'range' => [
840 + 'px' => [
841 + 'min' => 0,
842 + 'max' => 100,
843 + ],
844 + ],
845 + 'selectors' => [
846 + '{{WRAPPER}}' => '--ui-e-ico-box-icon-spacing: {{SIZE}}{{UNIT}} !important;',
847 + ],
848 + ]
849 + );
830 850
831 - $this->add_control(
832 - 'image_fullwidth',
833 - [
834 - 'label' => esc_html__('Image Fullwidth', 'uicore-elements'),
835 - 'type' => Controls_Manager::SWITCHER,
836 - 'selectors' => [
837 - '{{WRAPPER}} .ui-e-icon-wrp' => 'width: 100%; box-sizing: border-box;
851 + $this->add_control(
852 + 'image_fullwidth',
853 + [
854 + 'label' => esc_html__('Image Fullwidth', 'uicore-elements'),
855 + 'type' => Controls_Manager::SWITCHER,
856 + 'selectors' => [
857 + '{{WRAPPER}} .ui-e-icon-wrp' => 'width: 100%; box-sizing: border-box;
838 858 margin-left: calc(var(--ui-e-content-padding-left) * -1);
839 859 margin-right: calc(var(--ui-e-content-padding-right) * -1);
840 860 margin-top: calc(var(--ui-e-content-padding-top) *-1);',
841 - ],
842 - 'condition' => [
843 - 'icon_type' => 'image'
844 - ]
845 - ]
846 - );
861 + ],
862 + 'condition' => [
863 + 'icon_type' => 'image'
864 + ]
865 + ]
866 + );
847 867
848 - $this->add_responsive_control(
849 - 'icon_size',
850 - [
851 - 'label' => esc_html__('Size', 'uicore-elements'),
852 - 'type' => Controls_Manager::SLIDER,
853 - 'size_units' => ['px', 'em', 'vh', 'vw'],
854 - 'range' => [
855 - 'px' => [
856 - 'min' => 6,
857 - 'max' => 300,
858 - ],
859 - ],
860 - 'default' => [
861 - 'unit' => 'px',
862 - 'size' => 42,
863 - ],
864 - 'selectors' => [
865 - '{{WRAPPER}} .ui-e-icon-wrp' => '--ui-e-media-size: {{SIZE}}{{UNIT}};',
866 - ],
867 - 'condition' => [
868 - 'icon_type' => 'icon',
869 - ],
870 - ]
871 - );
868 + $this->add_responsive_control(
869 + 'icon_size',
870 + [
871 + 'label' => esc_html__('Size', 'uicore-elements'),
872 + 'type' => Controls_Manager::SLIDER,
873 + 'size_units' => ['px', 'em', 'vh', 'vw'],
874 + 'range' => [
875 + 'px' => [
876 + 'min' => 6,
877 + 'max' => 300,
878 + ],
879 + ],
880 + 'default' => [
881 + 'unit' => 'px',
882 + 'size' => 42,
883 + ],
884 + 'selectors' => [
885 + '{{WRAPPER}} .ui-e-icon-wrp' => '--ui-e-media-size: {{SIZE}}{{UNIT}};',
886 + ],
887 + 'condition' => [
888 + 'icon_type' => 'icon',
889 + ],
890 + ]
891 + );
872 892
873 - $this->add_responsive_control(
874 - 'image_size',
875 - [
876 - 'label' => esc_html__('Size', 'uicore-elements'),
877 - 'type' => Controls_Manager::SLIDER,
878 - 'size_units' => ['px', 'em', 'vh', 'vw'],
879 - 'range' => [
880 - 'px' => [
881 - 'min' => 6,
882 - 'max' => 300,
883 - ],
884 - ],
885 - 'default' => [
886 - 'unit' => 'px',
887 - 'size' => 120,
888 - ],
889 - 'selectors' => [
890 - '{{WRAPPER}} .ui-e-icon-wrp' => '--ui-e-media-size: {{SIZE}}{{UNIT}};',
891 - ],
892 - 'conditions' => [
893 - 'relation' => 'and',
894 - 'terms' => [
895 - [
896 - 'name' => 'image_fullwidth',
897 - 'operator' => '==',
898 - 'value' => ''
899 - ],
900 - [
901 - 'name' => 'icon_type',
902 - 'operator' => '==',
903 - 'value' => 'image'
904 - ],
905 - ]
906 - ]
907 - ]
908 - );
893 + $this->add_responsive_control(
894 + 'image_size',
895 + [
896 + 'label' => esc_html__('Size', 'uicore-elements'),
897 + 'type' => Controls_Manager::SLIDER,
898 + 'size_units' => ['px', 'em', 'vh', 'vw'],
899 + 'range' => [
900 + 'px' => [
901 + 'min' => 6,
902 + 'max' => 300,
903 + ],
904 + ],
905 + 'default' => [
906 + 'unit' => 'px',
907 + 'size' => 120,
908 + ],
909 + 'selectors' => [
910 + '{{WRAPPER}} .ui-e-icon-wrp' => '--ui-e-media-size: {{SIZE}}{{UNIT}};',
911 + ],
912 + 'conditions' => [
913 + 'relation' => 'and',
914 + 'terms' => [
915 + [
916 + 'name' => 'image_fullwidth',
917 + 'operator' => '==',
918 + 'value' => ''
919 + ],
920 + [
921 + 'name' => 'icon_type',
922 + 'operator' => '==',
923 + 'value' => 'image'
924 + ],
925 + ]
926 + ]
927 + ]
928 + );
909 929
910 - $this->add_control(
911 - 'rotate',
912 - [
913 - 'label' => esc_html__('Rotate', 'uicore-elements'),
914 - 'type' => Controls_Manager::SLIDER,
915 - 'default' => [
916 - 'size' => 0,
917 - 'unit' => 'deg',
918 - ],
919 - 'range' => [
920 - 'deg' => [
921 - 'max' => 360,
922 - 'min' => -360,
923 - ],
924 - ],
925 - 'selectors' => [
926 - '{{WRAPPER}}' => '--ui-e-ico-box-icon-rotate: {{SIZE}}{{UNIT}};',
927 - ],
928 - ]
929 - );
930 + $this->add_control(
931 + 'rotate',
932 + [
933 + 'label' => esc_html__('Rotate', 'uicore-elements'),
934 + 'type' => Controls_Manager::SLIDER,
935 + 'default' => [
936 + 'size' => 0,
937 + 'unit' => 'deg',
938 + ],
939 + 'range' => [
940 + 'deg' => [
941 + 'max' => 360,
942 + 'min' => -360,
943 + ],
944 + ],
945 + 'selectors' => [
946 + '{{WRAPPER}}' => '--ui-e-ico-box-icon-rotate: {{SIZE}}{{UNIT}};',
947 + ],
948 + ]
949 + );
930 950
931 - $this->add_control(
932 - 'icon_background_rotate',
933 - [
934 - 'label' => esc_html__('Background Rotate', 'uicore-elements'),
935 - 'type' => Controls_Manager::SLIDER,
936 - 'default' => [
937 - 'size' => 0,
938 - 'unit' => 'deg',
939 - ],
940 - 'range' => [
941 - 'deg' => [
942 - 'max' => 360,
943 - 'min' => -360,
944 - ],
945 - ],
946 - 'selectors' => [
947 - '{{WRAPPER}} .ui-e-icon-wrp' => '--ui-e-ico-box-icon-wrp-rotate: {{SIZE}}{{UNIT}};',
948 - ],
949 - ]
950 - );
951 + $this->add_control(
952 + 'icon_background_rotate',
953 + [
954 + 'label' => esc_html__('Background Rotate', 'uicore-elements'),
955 + 'type' => Controls_Manager::SLIDER,
956 + 'default' => [
957 + 'size' => 0,
958 + 'unit' => 'deg',
959 + ],
960 + 'range' => [
961 + 'deg' => [
962 + 'max' => 360,
963 + 'min' => -360,
964 + ],
965 + ],
966 + 'selectors' => [
967 + '{{WRAPPER}} .ui-e-icon-wrp' => '--ui-e-ico-box-icon-wrp-rotate: {{SIZE}}{{UNIT}};',
968 + ],
969 + ]
970 + );
951 971
952 - $this->add_responsive_control(
953 - 'icon_vertical_offset',
954 - [
955 - 'label' => esc_html__('Icon Vertical Offset', 'uicore-elements'),
956 - 'type' => Controls_Manager::SLIDER,
957 - 'range' => [
958 - 'px' => [
959 - 'min' => -200,
960 - 'max' => 200,
961 - ],
962 - ],
963 - 'default' => [
964 - 'size' => 0,
965 - ],
966 - 'selectors' => [
967 - '{{WRAPPER}} .ui-e-icon-wrp' => '--ui-e-ico-box-vertical-off: {{SIZE}}px'
968 - ],
969 - ]
970 - );
972 + $this->add_responsive_control(
973 + 'icon_vertical_offset',
974 + [
975 + 'label' => esc_html__('Icon Vertical Offset', 'uicore-elements'),
976 + 'type' => Controls_Manager::SLIDER,
977 + 'range' => [
978 + 'px' => [
979 + 'min' => -200,
980 + 'max' => 200,
981 + ],
982 + ],
983 + 'default' => [
984 + 'size' => 0,
985 + ],
986 + 'selectors' => [
987 + '{{WRAPPER}} .ui-e-icon-wrp' => '--ui-e-ico-box-vertical-off: {{SIZE}}px'
988 + ],
989 + ]
990 + );
971 991
972 - $this->add_responsive_control(
973 - 'icon_horizontal_offset',
974 - [
975 - 'label' => esc_html__('Icon Horizontal Offset', 'uicore-elements'),
976 - 'type' => Controls_Manager::SLIDER,
977 - 'range' => [
978 - 'px' => [
979 - 'min' => -200,
980 - 'max' => 200,
981 - ],
982 - ],
983 - 'default' => [
984 - 'size' => 0,
985 - ],
986 - 'selectors' => [
987 - '{{WRAPPER}} .ui-e-icon-wrp' => '--ui-e-ico-box-horizontal-off: {{SIZE}}px'
988 - ],
989 - ]
990 - );
992 + $this->add_responsive_control(
993 + 'icon_horizontal_offset',
994 + [
995 + 'label' => esc_html__('Icon Horizontal Offset', 'uicore-elements'),
996 + 'type' => Controls_Manager::SLIDER,
997 + 'range' => [
998 + 'px' => [
999 + 'min' => -200,
1000 + 'max' => 200,
1001 + ],
1002 + ],
1003 + 'default' => [
1004 + 'size' => 0,
1005 + ],
1006 + 'selectors' => [
1007 + '{{WRAPPER}} .ui-e-icon-wrp' => '--ui-e-ico-box-horizontal-off: {{SIZE}}px'
1008 + ],
1009 + ]
1010 + );
991 1011
992 - $this->add_control(
993 - 'image_icon_heading',
994 - [
995 - 'label' => esc_html__('Image Effect', 'uicore-elements'),
996 - 'type' => Controls_Manager::HEADING,
997 - 'separator' => 'before',
998 - 'condition' => [
999 - 'icon_type' => 'image',
1000 - ],
1001 - ]
1002 - );
1012 + $this->add_control(
1013 + 'image_icon_heading',
1014 + [
1015 + 'label' => esc_html__('Image Effect', 'uicore-elements'),
1016 + 'type' => Controls_Manager::HEADING,
1017 + 'separator' => 'before',
1018 + 'condition' => [
1019 + 'icon_type' => 'image',
1020 + ],
1021 + ]
1022 + );
1003 1023
1004 - $this->add_group_control(
1005 - Group_Control_Css_Filter::get_type(),
1006 - [
1007 - 'name' => 'css_filters',
1008 - 'selector' => '{{WRAPPER}} .ui-e-ico-box img',
1009 - 'condition' => [
1010 - 'icon_type' => 'image',
1011 - ],
1012 - ]
1013 - );
1024 + $this->add_group_control(
1025 + Group_Control_Css_Filter::get_type(),
1026 + [
1027 + 'name' => 'css_filters',
1028 + 'selector' => '{{WRAPPER}} .ui-e-ico-box img',
1029 + 'condition' => [
1030 + 'icon_type' => 'image',
1031 + ],
1032 + ]
1033 + );
1014 1034
1015 - $this->add_control(
1016 - 'image_opacity',
1017 - [
1018 - 'label' => esc_html__('Opacity', 'uicore-elements'),
1019 - 'type' => Controls_Manager::SLIDER,
1020 - 'range' => [
1021 - 'px' => [
1022 - 'max' => 1,
1023 - 'min' => 0.10,
1024 - 'step' => 0.01,
1025 - ],
1026 - ],
1027 - 'selectors' => [
1028 - '{{WRAPPER}} .ui-e-ico-box img' => 'opacity: {{SIZE}};',
1029 - ],
1030 - 'condition' => [
1031 - 'icon_type' => 'image',
1032 - ],
1033 - ]
1034 - );
1035 + $this->add_control(
1036 + 'image_opacity',
1037 + [
1038 + 'label' => esc_html__('Opacity', 'uicore-elements'),
1039 + 'type' => Controls_Manager::SLIDER,
1040 + 'range' => [
1041 + 'px' => [
1042 + 'max' => 1,
1043 + 'min' => 0.10,
1044 + 'step' => 0.01,
1045 + ],
1046 + ],
1047 + 'selectors' => [
1048 + '{{WRAPPER}} .ui-e-ico-box img' => 'opacity: {{SIZE}};',
1049 + ],
1050 + 'condition' => [
1051 + 'icon_type' => 'image',
1052 + ],
1053 + ]
1054 + );
1035 1055
1036 - $this->add_control(
1037 - 'background_hover_transition',
1038 - [
1039 - 'label' => esc_html__('Transition Duration', 'uicore-elements'),
1040 - 'type' => Controls_Manager::SLIDER,
1041 - 'default' => [
1042 - 'size' => 0.3,
1043 - ],
1044 - 'range' => [
1045 - 'px' => [
1046 - 'max' => 3,
1047 - 'step' => 0.1,
1048 - ],
1049 - ],
1050 - 'selectors' => [
1051 - '{{WRAPPER}} .ui-e-icon-wrp img' => 'transition-duration: {{SIZE}}s',
1052 - '{{WRAPPER}}:hover .ui-e-icon-wrp img' => 'transform: ',
1053 - ],
1054 - 'condition' => [
1055 - 'icon_type' => 'image',
1056 - ],
1057 - ]
1058 - );
1056 + $this->add_control(
1057 + 'background_hover_transition',
1058 + [
1059 + 'label' => esc_html__('Transition Duration', 'uicore-elements'),
1060 + 'type' => Controls_Manager::SLIDER,
1061 + 'default' => [
1062 + 'size' => 0.3,
1063 + ],
1064 + 'range' => [
1065 + 'px' => [
1066 + 'max' => 3,
1067 + 'step' => 0.1,
1068 + ],
1069 + ],
1070 + 'selectors' => [
1071 + '{{WRAPPER}} .ui-e-icon-wrp img' => 'transition-duration: {{SIZE}}s',
1072 + '{{WRAPPER}}:hover .ui-e-icon-wrp img' => 'transform: ',
1073 + ],
1074 + 'condition' => [
1075 + 'icon_type' => 'image',
1076 + ],
1077 + ]
1078 + );
1059 1079
1060 - $this->end_controls_tab();
1080 + $this->end_controls_tab();
1061 1081
1062 - $this->start_controls_tab(
1063 - 'icon_hover',
1064 - [
1065 - 'label' => esc_html__('Hover', 'uicore-elements'),
1066 - ]
1067 - );
1082 + $this->start_controls_tab(
1083 + 'icon_hover',
1084 + [
1085 + 'label' => esc_html__('Hover', 'uicore-elements'),
1086 + ]
1087 + );
1068 1088
1069 - $this->add_control(
1070 - 'icon_hover_color',
1071 - [
1072 - 'label' => esc_html__('Icon Color', 'uicore-elements'),
1073 - 'type' => Controls_Manager::COLOR,
1074 - 'selectors' => [
1075 - '{{WRAPPER}}:hover .ui-e-icon-wrp' => 'color: {{VALUE}};',
1089 + $this->add_control(
1090 + 'icon_hover_color',
1091 + [
1092 + 'label' => esc_html__('Icon Color', 'uicore-elements'),
1093 + 'type' => Controls_Manager::COLOR,
1094 + 'selectors' => [
1095 + '{{WRAPPER}}:hover .ui-e-icon-wrp' => 'color: {{VALUE}};',
1076 1096 '{{WRAPPER}}:hover .ui-e-icon-wrp i' => 'color: {{VALUE}};',
1077 - '{{WRAPPER}}:hover .ui-e-icon-wrp svg' => 'fill: {{VALUE}};',
1078 - ],
1079 - 'condition' => [
1080 - 'icon_type!' => 'image',
1081 - ],
1082 - ]
1083 - );
1097 + '{{WRAPPER}}:hover .ui-e-icon-wrp svg' => 'fill: {{VALUE}};',
1098 + ],
1099 + 'condition' => [
1100 + 'icon_type!' => 'image',
1101 + ],
1102 + ]
1103 + );
1084 1104
1085 - $this->add_control(
1086 - 'svg_icon_hover_fill_color',
1087 - [
1088 - 'label' => esc_html__('Fill Color', 'uicore-elements'),
1089 - 'type' => Controls_Manager::COLOR,
1090 - 'selectors' => [
1091 - '{{WRAPPER}}:hover .ui-e-icon-wrp svg, {{WRAPPER}}:hover .ui-e-icon-wrp svg *' => 'fill: {{VALUE}};',
1092 - ],
1093 - 'condition' => [
1094 - 'icon_type!' => 'image',
1095 - 'show_svg_icon_color' => 'yes',
1096 - ],
1097 - ]
1098 - );
1105 + $this->add_control(
1106 + 'svg_icon_hover_fill_color',
1107 + [
1108 + 'label' => esc_html__('Fill Color', 'uicore-elements'),
1109 + 'type' => Controls_Manager::COLOR,
1110 + 'selectors' => [
1111 + '{{WRAPPER}}:hover .ui-e-icon-wrp svg, {{WRAPPER}}:hover .ui-e-icon-wrp svg *' => 'fill: {{VALUE}};',
1112 + ],
1113 + 'condition' => [
1114 + 'icon_type!' => 'image',
1115 + 'show_svg_icon_color' => 'yes',
1116 + ],
1117 + ]
1118 + );
1099 1119
1100 - $this->add_control(
1101 - 'svg_icon_hover_stroke_color',
1102 - [
1103 - 'label' => esc_html__('Stroke Color', 'uicore-elements'),
1104 - 'type' => Controls_Manager::COLOR,
1105 - 'selectors' => [
1106 - '{{WRAPPER}}:hover .ui-e-icon-wrp svg, {{WRAPPER}}:hover .ui-e-icon-wrp svg *' => 'stroke: {{VALUE}};',
1107 - ],
1108 - 'condition' => [
1109 - 'icon_type!' => 'image',
1110 - 'show_svg_icon_color' => 'yes',
1111 - ],
1112 - ]
1113 - );
1120 + $this->add_control(
1121 + 'svg_icon_hover_stroke_color',
1122 + [
1123 + 'label' => esc_html__('Stroke Color', 'uicore-elements'),
1124 + 'type' => Controls_Manager::COLOR,
1125 + 'selectors' => [
1126 + '{{WRAPPER}}:hover .ui-e-icon-wrp svg, {{WRAPPER}}:hover .ui-e-icon-wrp svg *' => 'stroke: {{VALUE}};',
1127 + ],
1128 + 'condition' => [
1129 + 'icon_type!' => 'image',
1130 + 'show_svg_icon_color' => 'yes',
1131 + ],
1132 + ]
1133 + );
1114 1134
1115 - $this->add_group_control(
1116 - Group_Control_Background::get_type(),
1117 - [
1118 - 'name' => 'icon_hover_background',
1119 - 'separator' => 'before',
1120 - 'selector' => '{{WRAPPER}}:hover .ui-e-icon-wrp',
1121 - ]
1122 - );
1135 + $this->add_group_control(
1136 + Group_Control_Background::get_type(),
1137 + [
1138 + 'name' => 'icon_hover_background',
1139 + 'separator' => 'before',
1140 + 'selector' => '{{WRAPPER}}:hover .ui-e-icon-wrp',
1141 + ]
1142 + );
1123 1143
1124 - $this->add_control(
1125 - 'icon_hover_border_color',
1126 - [
1127 - 'label' => esc_html__('Border Color', 'uicore-elements'),
1128 - 'type' => Controls_Manager::COLOR,
1129 - 'separator' => 'before',
1130 - 'selectors' => [
1131 - '{{WRAPPER}}:hover .ui-e-icon-wrp' => 'border-color: {{VALUE}};',
1132 - ],
1133 - 'condition' => [
1134 - 'icon_border_border!' => '',
1135 - ],
1136 - ]
1137 - );
1144 + $this->add_control(
1145 + 'icon_hover_border_color',
1146 + [
1147 + 'label' => esc_html__('Border Color', 'uicore-elements'),
1148 + 'type' => Controls_Manager::COLOR,
1149 + 'separator' => 'before',
1150 + 'selectors' => [
1151 + '{{WRAPPER}}:hover .ui-e-icon-wrp' => 'border-color: {{VALUE}};',
1152 + ],
1153 + 'condition' => [
1154 + 'icon_border_border!' => '',
1155 + ],
1156 + ]
1157 + );
1138 1158
1139 - $this->add_responsive_control(
1140 - 'icon_hover_radius',
1141 - [
1142 - 'label' => esc_html__('Border Radius', 'uicore-elements'),
1143 - 'type' => Controls_Manager::DIMENSIONS,
1144 - 'size_units' => ['px', '%'],
1145 - 'separator' => 'after',
1146 - 'selectors' => [
1147 - '{{WRAPPER}}:hover .ui-e-icon-wrp' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow: hidden;',
1148 - '{{WRAPPER}}:hover .ui-e-icon-wrp img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow: hidden;'
1149 - ]
1150 - ]
1151 - );
1159 + $this->add_responsive_control(
1160 + 'icon_hover_radius',
1161 + [
1162 + 'label' => esc_html__('Border Radius', 'uicore-elements'),
1163 + 'type' => Controls_Manager::DIMENSIONS,
1164 + 'size_units' => ['px', '%'],
1165 + 'separator' => 'after',
1166 + 'selectors' => [
1167 + '{{WRAPPER}}:hover .ui-e-icon-wrp' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow: hidden;',
1168 + '{{WRAPPER}}:hover .ui-e-icon-wrp img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow: hidden;'
1169 + ]
1170 + ]
1171 + );
1152 1172
1153 - $this->add_group_control(
1154 - Group_Control_Box_Shadow::get_type(),
1155 - [
1156 - 'name' => 'icon_hover_shadow',
1157 - 'selector' => '{{WRAPPER}}:hover .ui-e-icon-wrp'
1158 - ]
1159 - );
1173 + $this->add_group_control(
1174 + Group_Control_Box_Shadow::get_type(),
1175 + [
1176 + 'name' => 'icon_hover_shadow',
1177 + 'selector' => '{{WRAPPER}}:hover .ui-e-icon-wrp'
1178 + ]
1179 + );
1160 1180
1161 - $this->add_control(
1162 - 'image_icon_hover_heading',
1163 - [
1164 - 'label' => esc_html__('Image Effect', 'uicore-elements'),
1165 - 'type' => Controls_Manager::HEADING,
1166 - 'separator' => 'before',
1167 - 'condition' => [
1168 - 'icon_type' => 'image',
1169 - ],
1170 - ]
1171 - );
1181 + $this->add_control(
1182 + 'image_icon_hover_heading',
1183 + [
1184 + 'label' => esc_html__('Image Effect', 'uicore-elements'),
1185 + 'type' => Controls_Manager::HEADING,
1186 + 'separator' => 'before',
1187 + 'condition' => [
1188 + 'icon_type' => 'image',
1189 + ],
1190 + ]
1191 + );
1172 1192
1173 - $this->add_group_control(
1174 - Group_Control_Css_Filter::get_type(),
1175 - [
1176 - 'name' => 'css_filters_hover',
1177 - 'selector' => '{{WRAPPER}}:hover .ui-e-icon-wrp img',
1178 - 'condition' => [
1179 - 'icon_type' => 'image',
1180 - ],
1181 - ]
1182 - );
1193 + $this->add_group_control(
1194 + Group_Control_Css_Filter::get_type(),
1195 + [
1196 + 'name' => 'css_filters_hover',
1197 + 'selector' => '{{WRAPPER}}:hover .ui-e-icon-wrp img',
1198 + 'condition' => [
1199 + 'icon_type' => 'image',
1200 + ],
1201 + ]
1202 + );
1183 1203
1184 - $this->add_control(
1185 - 'image_opacity_hover',
1186 - [
1187 - 'label' => esc_html__('Opacity', 'uicore-elements'),
1188 - 'type' => Controls_Manager::SLIDER,
1189 - 'range' => [
1190 - 'px' => [
1191 - 'max' => 1,
1192 - 'min' => 0.10,
1193 - 'step' => 0.01,
1194 - ],
1195 - ],
1196 - 'selectors' => [
1197 - '{{WRAPPER}}:hover .ui-e-icon-wrp img' => 'opacity: {{SIZE}};',
1198 - ],
1199 - 'condition' => [
1200 - 'icon_type' => 'image',
1201 - ],
1202 - ]
1203 - );
1204 + $this->add_control(
1205 + 'image_opacity_hover',
1206 + [
1207 + 'label' => esc_html__('Opacity', 'uicore-elements'),
1208 + 'type' => Controls_Manager::SLIDER,
1209 + 'range' => [
1210 + 'px' => [
1211 + 'max' => 1,
1212 + 'min' => 0.10,
1213 + 'step' => 0.01,
1214 + ],
1215 + ],
1216 + 'selectors' => [
1217 + '{{WRAPPER}}:hover .ui-e-icon-wrp img' => 'opacity: {{SIZE}};',
1218 + ],
1219 + 'condition' => [
1220 + 'icon_type' => 'image',
1221 + ],
1222 + ]
1223 + );
1204 1224
1205 - $this->end_controls_tab();
1225 + $this->end_controls_tab();
1206 1226
1207 - $this->end_controls_tabs();
1227 + $this->end_controls_tabs();
1208 1228
1209 - $this->end_controls_section();
1229 + $this->end_controls_section();
1210 1230
1211 - $this->start_controls_section(
1212 - 'section_style_title',
1213 - [
1214 - 'label' => esc_html__('Title', 'uicore-elements'),
1215 - 'tab' => Controls_Manager::TAB_STYLE,
1216 - ]
1217 - );
1231 + $this->start_controls_section(
1232 + 'section_style_title',
1233 + [
1234 + 'label' => esc_html__('Title', 'uicore-elements'),
1235 + 'tab' => Controls_Manager::TAB_STYLE,
1236 + ]
1237 + );
1218 1238
1219 - $this->start_controls_tabs('tabs_title_style');
1239 + $this->start_controls_tabs('tabs_title_style');
1220 1240
1221 - $this->start_controls_tab(
1222 - 'tab_title_style_normal',
1223 - [
1224 - 'label' => esc_html__('Normal', 'uicore-elements'),
1225 - ]
1226 - );
1241 + $this->start_controls_tab(
1242 + 'tab_title_style_normal',
1243 + [
1244 + 'label' => esc_html__('Normal', 'uicore-elements'),
1245 + ]
1246 + );
1227 1247
1228 - $this->add_control(
1229 - 'title_color',
1230 - [
1231 - 'label' => esc_html__('Color', 'uicore-elements'),
1232 - 'type' => Controls_Manager::COLOR,
1233 - 'selectors' => [
1234 - '{{WRAPPER}} .ui-e-title' => 'color: {{VALUE}};',
1235 - ],
1236 - ]
1237 - );
1248 + $this->add_control(
1249 + 'title_color',
1250 + [
1251 + 'label' => esc_html__('Color', 'uicore-elements'),
1252 + 'type' => Controls_Manager::COLOR,
1253 + 'selectors' => [
1254 + '{{WRAPPER}} .ui-e-title' => 'color: {{VALUE}};',
1255 + ],
1256 + ]
1257 + );
1238 1258
1239 - $this->end_controls_tab();
1259 + $this->end_controls_tab();
1240 1260
1241 - $this->start_controls_tab(
1242 - 'tab_title_style_hover',
1243 - [
1244 - 'label' => esc_html__('Hover', 'uicore-elements'),
1245 - ]
1246 - );
1261 + $this->start_controls_tab(
1262 + 'tab_title_style_hover',
1263 + [
1264 + 'label' => esc_html__('Hover', 'uicore-elements'),
1265 + ]
1266 + );
1247 1267
1248 - $this->add_control(
1249 - 'title_color_hover',
1250 - [
1251 - 'label' => esc_html__('Color', 'uicore-elements'),
1252 - 'type' => Controls_Manager::COLOR,
1253 - 'selectors' => [
1254 - '{{WRAPPER}}:hover .ui-e-title' => 'color: {{VALUE}};',
1255 - ],
1256 - ]
1257 - );
1268 + $this->add_control(
1269 + 'title_color_hover',
1270 + [
1271 + 'label' => esc_html__('Color', 'uicore-elements'),
1272 + 'type' => Controls_Manager::COLOR,
1273 + 'selectors' => [
1274 + '{{WRAPPER}}:hover .ui-e-title' => 'color: {{VALUE}};',
1275 + ],
1276 + ]
1277 + );
1258 1278
1259 - $this->end_controls_tab();
1279 + $this->end_controls_tab();
1260 1280
1261 - $this->end_controls_tabs();
1281 + $this->end_controls_tabs();
1262 1282
1263 1283
1264 - $this->add_responsive_control(
1265 - 'title_bottom_space',
1266 - [
1267 - 'label' => esc_html__('Spacing', 'uicore-elements'),
1268 - 'type' => Controls_Manager::SLIDER,
1269 - 'range' => [
1270 - 'px' => [
1271 - 'min' => 0,
1272 - 'max' => 100,
1273 - ],
1274 - ],
1275 - 'separator' => 'before',
1276 - 'default' => [
1277 - 'unit' => 'px',
1278 - 'size' => 0,
1279 - ],
1280 - 'selectors' => [
1281 - '{{WRAPPER}} .ui-e-title' => 'margin-bottom: {{SIZE}}{{UNIT}} !important;',
1282 - ],
1283 - ]
1284 - );
1284 + $this->add_responsive_control(
1285 + 'title_bottom_space',
1286 + [
1287 + 'label' => esc_html__('Spacing', 'uicore-elements'),
1288 + 'type' => Controls_Manager::SLIDER,
1289 + 'range' => [
1290 + 'px' => [
1291 + 'min' => 0,
1292 + 'max' => 100,
1293 + ],
1294 + ],
1295 + 'separator' => 'before',
1296 + 'default' => [
1297 + 'unit' => 'px',
1298 + 'size' => 0,
1299 + ],
1300 + 'selectors' => [
1301 + '{{WRAPPER}} .ui-e-title' => 'margin-bottom: {{SIZE}}{{UNIT}} !important;',
1302 + ],
1303 + ]
1304 + );
1285 1305
1286 - $this->add_group_control(
1287 - Group_Control_Typography::get_type(),
1288 - [
1289 - 'name' => 'title_typography',
1290 - 'selector' => '{{WRAPPER}} .ui-e-title',
1291 - ]
1292 - );
1306 + $this->add_group_control(
1307 + Group_Control_Typography::get_type(),
1308 + [
1309 + 'name' => 'title_typography',
1310 + 'selector' => '{{WRAPPER}} .ui-e-title',
1311 + ]
1312 + );
1293 1313
1294 - $this->end_controls_section();
1314 + $this->end_controls_section();
1295 1315
1296 - $this->start_controls_section(
1297 - 'section_style_sub_title',
1298 - [
1299 - 'label' => esc_html__('Subtitle', 'uicore-elements'),
1300 - 'tab' => Controls_Manager::TAB_STYLE,
1301 - 'condition' => [
1302 - 'sub_title_text!' => '',
1303 - ],
1304 - ]
1305 - );
1316 + $this->start_controls_section(
1317 + 'section_style_sub_title',
1318 + [
1319 + 'label' => esc_html__('Subtitle', 'uicore-elements'),
1320 + 'tab' => Controls_Manager::TAB_STYLE,
1321 + 'condition' => [
1322 + 'sub_title_text!' => '',
1323 + ],
1324 + ]
1325 + );
1306 1326
1307 - $this->start_controls_tabs('tabs_sub_title_style');
1327 + $this->start_controls_tabs('tabs_sub_title_style');
1308 1328
1309 - $this->start_controls_tab(
1310 - 'tab_sub_title_style_normal',
1311 - [
1312 - 'label' => esc_html__('Normal', 'uicore-elements'),
1313 - ]
1314 - );
1329 + $this->start_controls_tab(
1330 + 'tab_sub_title_style_normal',
1331 + [
1332 + 'label' => esc_html__('Normal', 'uicore-elements'),
1333 + ]
1334 + );
1315 1335
1316 - $this->add_control(
1317 - 'sub_title_color',
1318 - [
1319 - 'label' => esc_html__('Color', 'uicore-elements'),
1320 - 'type' => Controls_Manager::COLOR,
1321 - 'selectors' => [
1322 - '{{WRAPPER}} .ui-e-subtitle' => 'color: {{VALUE}};',
1323 - ],
1324 - ]
1325 - );
1336 + $this->add_control(
1337 + 'sub_title_color',
1338 + [
1339 + 'label' => esc_html__('Color', 'uicore-elements'),
1340 + 'type' => Controls_Manager::COLOR,
1341 + 'selectors' => [
1342 + '{{WRAPPER}} .ui-e-subtitle' => 'color: {{VALUE}};',
1343 + ],
1344 + ]
1345 + );
1326 1346
1327 - $this->end_controls_tab();
1347 + $this->end_controls_tab();
1328 1348
1329 - $this->start_controls_tab(
1330 - 'tab_sub_title_style_hover',
1331 - [
1332 - 'label' => esc_html__('Hover', 'uicore-elements'),
1333 - ]
1334 - );
1349 + $this->start_controls_tab(
1350 + 'tab_sub_title_style_hover',
1351 + [
1352 + 'label' => esc_html__('Hover', 'uicore-elements'),
1353 + ]
1354 + );
1335 1355
1336 - $this->add_control(
1337 - 'sub_title_color_hover',
1338 - [
1339 - 'label' => esc_html__('Color', 'uicore-elements'),
1340 - 'type' => Controls_Manager::COLOR,
1341 - 'selectors' => [
1342 - '{{WRAPPER}}:hover .ui-e-subtitle' => 'color: {{VALUE}};',
1343 - ],
1344 - ]
1345 - );
1356 + $this->add_control(
1357 + 'sub_title_color_hover',
1358 + [
1359 + 'label' => esc_html__('Color', 'uicore-elements'),
1360 + 'type' => Controls_Manager::COLOR,
1361 + 'selectors' => [
1362 + '{{WRAPPER}}:hover .ui-e-subtitle' => 'color: {{VALUE}};',
1363 + ],
1364 + ]
1365 + );
1346 1366
1347 - $this->end_controls_tab();
1367 + $this->end_controls_tab();
1348 1368
1349 - $this->end_controls_tabs();
1369 + $this->end_controls_tabs();
1350 1370
1351 - $this->add_responsive_control(
1352 - 'sub_title_bottom_space',
1353 - [
1354 - 'label' => esc_html__('Spacing', 'uicore-elements'),
1355 - 'type' => Controls_Manager::SLIDER,
1356 - 'range' => [
1357 - 'px' => [
1358 - 'min' => 0,
1359 - 'max' => 100,
1360 - ],
1361 - ],
1362 - 'separator' => 'before',
1363 - 'default' => [
1364 - 'unit' => 'px',
1365 - 'size' => 20,
1366 - ],
1367 - 'selectors' => [
1368 - '{{WRAPPER}} .ui-e-subtitle' => 'margin-bottom: {{SIZE}}{{UNIT}} !important;',
1369 - ],
1370 - ]
1371 - );
1371 + $this->add_responsive_control(
1372 + 'sub_title_bottom_space',
1373 + [
1374 + 'label' => esc_html__('Spacing', 'uicore-elements'),
1375 + 'type' => Controls_Manager::SLIDER,
1376 + 'range' => [
1377 + 'px' => [
1378 + 'min' => 0,
1379 + 'max' => 100,
1380 + ],
1381 + ],
1382 + 'separator' => 'before',
1383 + 'default' => [
1384 + 'unit' => 'px',
1385 + 'size' => 20,
1386 + ],
1387 + 'selectors' => [
1388 + '{{WRAPPER}} .ui-e-subtitle' => 'margin-bottom: {{SIZE}}{{UNIT}} !important;',
1389 + ],
1390 + ]
1391 + );
1372 1392
1373 - $this->add_group_control(
1374 - Group_Control_Typography::get_type(),
1375 - [
1376 - 'name' => 'sub_title_typography',
1377 - 'selector' => '{{WRAPPER}} .ui-e-subtitle',
1378 - ]
1379 - );
1393 + $this->add_group_control(
1394 + Group_Control_Typography::get_type(),
1395 + [
1396 + 'name' => 'sub_title_typography',
1397 + 'selector' => '{{WRAPPER}} .ui-e-subtitle',
1398 + ]
1399 + );
1380 1400
1381 - $this->end_controls_section();
1401 + $this->end_controls_section();
1382 1402
1383 - $this->start_controls_section(
1384 - 'section_style_description',
1385 - [
1386 - 'label' => esc_html__('Description', 'uicore-elements'),
1387 - 'tab' => Controls_Manager::TAB_STYLE,
1388 - ]
1389 - );
1403 + $this->start_controls_section(
1404 + 'section_style_description',
1405 + [
1406 + 'label' => esc_html__('Description', 'uicore-elements'),
1407 + 'tab' => Controls_Manager::TAB_STYLE,
1408 + ]
1409 + );
1390 1410
1391 - $this->start_controls_tabs('tabs_description_style');
1411 + $this->start_controls_tabs('tabs_description_style');
1392 1412
1393 - $this->start_controls_tab(
1394 - 'tab_description_style_normal',
1395 - [
1396 - 'label' => esc_html__('Normal', 'uicore-elements'),
1397 - ]
1398 - );
1413 + $this->start_controls_tab(
1414 + 'tab_description_style_normal',
1415 + [
1416 + 'label' => esc_html__('Normal', 'uicore-elements'),
1417 + ]
1418 + );
1399 1419
1400 - $this->add_control(
1401 - 'description_color',
1402 - [
1403 - 'label' => esc_html__('Color', 'uicore-elements'),
1404 - 'type' => Controls_Manager::COLOR,
1405 - 'selectors' => [
1406 - '{{WRAPPER}} .ui-e-description' => 'color: {{VALUE}};',
1407 - ],
1408 - ]
1409 - );
1420 + $this->add_control(
1421 + 'description_color',
1422 + [
1423 + 'label' => esc_html__('Color', 'uicore-elements'),
1424 + 'type' => Controls_Manager::COLOR,
1425 + 'selectors' => [
1426 + '{{WRAPPER}} .ui-e-description' => 'color: {{VALUE}};',
1427 + ],
1428 + ]
1429 + );
1410 1430
1411 - $this->end_controls_tab();
1431 + $this->end_controls_tab();
1412 1432
1413 - $this->start_controls_tab(
1414 - 'tab_description_style_hover',
1415 - [
1416 - 'label' => esc_html__('Hover', 'uicore-elements'),
1417 - ]
1418 - );
1433 + $this->start_controls_tab(
1434 + 'tab_description_style_hover',
1435 + [
1436 + 'label' => esc_html__('Hover', 'uicore-elements'),
1437 + ]
1438 + );
1419 1439
1420 - $this->add_control(
1421 - 'description_color_hover',
1422 - [
1423 - 'label' => esc_html__('Color', 'uicore-elements'),
1424 - 'type' => Controls_Manager::COLOR,
1425 - 'selectors' => [
1426 - '{{WRAPPER}}:hover .ui-e-description' => 'color: {{VALUE}};',
1427 - ],
1428 - ]
1429 - );
1440 + $this->add_control(
1441 + 'description_color_hover',
1442 + [
1443 + 'label' => esc_html__('Color', 'uicore-elements'),
1444 + 'type' => Controls_Manager::COLOR,
1445 + 'selectors' => [
1446 + '{{WRAPPER}}:hover .ui-e-description' => 'color: {{VALUE}};',
1447 + ],
1448 + ]
1449 + );
1430 1450
1431 - $this->end_controls_tab();
1451 + $this->end_controls_tab();
1432 1452
1433 - $this->end_controls_tabs();
1453 + $this->end_controls_tabs();
1434 1454
1435 - $this->add_responsive_control(
1436 - 'description_bottom_space',
1437 - [
1438 - 'label' => esc_html__('Spacing', 'uicore-elements'),
1439 - 'type' => Controls_Manager::SLIDER,
1440 - 'default' => [
1441 - 'unit' => 'px',
1442 - 'size' => 0,
1443 - ],
1444 - 'separator' => 'before',
1445 - 'selectors' => [
1446 - '{{WRAPPER}} .ui-e-description' => 'margin-bottom: {{SIZE}}{{UNIT}} !important;',
1447 - ],
1448 - ]
1449 - );
1455 + $this->add_responsive_control(
1456 + 'description_bottom_space',
1457 + [
1458 + 'label' => esc_html__('Spacing', 'uicore-elements'),
1459 + 'type' => Controls_Manager::SLIDER,
1460 + 'default' => [
1461 + 'unit' => 'px',
1462 + 'size' => 0,
1463 + ],
1464 + 'separator' => 'before',
1465 + 'selectors' => [
1466 + '{{WRAPPER}} .ui-e-description' => 'margin-bottom: {{SIZE}}{{UNIT}} !important;',
1467 + ],
1468 + ]
1469 + );
1450 1470
1451 - $this->add_group_control(
1452 - Group_Control_Typography::get_type(),
1453 - [
1454 - 'name' => 'description_typography',
1455 - 'selector' => '{{WRAPPER}} .ui-e-description',
1456 - ]
1457 - );
1471 + $this->add_group_control(
1472 + Group_Control_Typography::get_type(),
1473 + [
1474 + 'name' => 'description_typography',
1475 + 'selector' => '{{WRAPPER}} .ui-e-description',
1476 + ]
1477 + );
1458 1478
1459 - $this->end_controls_section();
1479 + $this->end_controls_section();
1460 1480
1461 - $this->start_controls_section(
1462 - 'section_style_readmore',
1463 - [
1464 - 'label' => esc_html__('Read More', 'uicore-elements'),
1465 - 'tab' => Controls_Manager::TAB_STYLE,
1466 - 'condition' => [
1467 - 'readmore' => 'yes',
1468 - ],
1469 - ]
1470 - );
1481 + $this->start_controls_section(
1482 + 'section_style_readmore',
1483 + [
1484 + 'label' => esc_html__('Read More', 'uicore-elements'),
1485 + 'tab' => Controls_Manager::TAB_STYLE,
1486 + 'condition' => [
1487 + 'readmore' => 'yes',
1488 + ],
1489 + ]
1490 + );
1471 1491
1472 - $this->start_controls_tabs('tabs_readmore_style');
1492 + $this->start_controls_tabs('tabs_readmore_style');
1473 1493
1474 - $this->start_controls_tab(
1475 - 'tab_readmore_normal',
1476 - [
1477 - 'label' => esc_html__('Normal', 'uicore-elements'),
1478 - ]
1479 - );
1494 + $this->start_controls_tab(
1495 + 'tab_readmore_normal',
1496 + [
1497 + 'label' => esc_html__('Normal', 'uicore-elements'),
1498 + ]
1499 + );
1480 1500
1481 - $this->add_group_control(
1482 - Group_Control_Typography::get_type(),
1483 - [
1484 - 'name' => 'readmore_typography',
1485 - 'selector' => '{{WRAPPER}} .ui-e-readmore',
1486 - ]
1487 - );
1501 + $this->add_group_control(
1502 + Group_Control_Typography::get_type(),
1503 + [
1504 + 'name' => 'readmore_typography',
1505 + 'selector' => '{{WRAPPER}} .ui-e-readmore',
1506 + ]
1507 + );
1488 1508
1489 - $this->add_control(
1490 - 'readmore_text_color',
1491 - [
1492 - 'label' => esc_html__('Color', 'uicore-elements'),
1493 - 'type' => Controls_Manager::COLOR,
1494 - 'selectors' => [
1495 - '{{WRAPPER}} .ui-e-readmore' => 'color: {{VALUE}};',
1496 - '{{WRAPPER}} .ui-e-readmore svg' => 'fill: {{VALUE}};',
1497 - ],
1498 - ]
1499 - );
1509 + $this->add_control(
1510 + 'readmore_text_color',
1511 + [
1512 + 'label' => esc_html__('Color', 'uicore-elements'),
1513 + 'type' => Controls_Manager::COLOR,
1514 + 'selectors' => [
1515 + '{{WRAPPER}} .ui-e-readmore' => 'color: {{VALUE}};',
1516 + '{{WRAPPER}} .ui-e-readmore svg' => 'fill: {{VALUE}};',
1517 + ],
1518 + ]
1519 + );
1500 1520
1501 - $this->add_group_control(
1502 - Group_Control_Background::get_type(),
1503 - [
1504 - 'name' => 'readmore_background',
1505 - 'selector' => '{{WRAPPER}} .ui-e-readmore',
1506 - ]
1507 - );
1521 + $this->add_group_control(
1522 + Group_Control_Background::get_type(),
1523 + [
1524 + 'name' => 'readmore_background',
1525 + 'selector' => '{{WRAPPER}} .ui-e-readmore',
1526 + ]
1527 + );
1508 1528
1509 - $this->add_group_control(
1510 - Group_Control_Border::get_type(),
1511 - [
1512 - 'name' => 'readmore_border',
1513 - 'placeholder' => '1px',
1514 - 'default' => '1px',
1515 - 'selector' => '{{WRAPPER}} .ui-e-readmore'
1516 - ]
1517 - );
1529 + $this->add_group_control(
1530 + Group_Control_Border::get_type(),
1531 + [
1532 + 'name' => 'readmore_border',
1533 + 'placeholder' => '1px',
1534 + 'default' => '1px',
1535 + 'selector' => '{{WRAPPER}} .ui-e-readmore'
1536 + ]
1537 + );
1518 1538
1519 - $this->add_responsive_control(
1520 - 'readmore_radius',
1521 - [
1522 - 'label' => esc_html__('Border Radius', 'uicore-elements'),
1523 - 'type' => Controls_Manager::DIMENSIONS,
1524 - 'size_units' => ['px', '%'],
1525 - 'selectors' => [
1526 - '{{WRAPPER}} .ui-e-readmore' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1527 - ],
1528 - ]
1529 - );
1539 + $this->add_responsive_control(
1540 + 'readmore_radius',
1541 + [
1542 + 'label' => esc_html__('Border Radius', 'uicore-elements'),
1543 + 'type' => Controls_Manager::DIMENSIONS,
1544 + 'size_units' => ['px', '%'],
1545 + 'selectors' => [
1546 + '{{WRAPPER}} .ui-e-readmore' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1547 + ],
1548 + ]
1549 + );
1530 1550
1531 - $this->add_responsive_control(
1532 - 'readmore_padding',
1533 - [
1534 - 'label' => esc_html__('Padding', 'uicore-elements'),
1535 - 'type' => Controls_Manager::DIMENSIONS,
1536 - 'size_units' => ['px', 'em', '%'],
1537 - 'selectors' => [
1538 - '{{WRAPPER}} .ui-e-readmore' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1539 - ],
1540 - ]
1541 - );
1551 + $this->add_responsive_control(
1552 + 'readmore_padding',
1553 + [
1554 + 'label' => esc_html__('Padding', 'uicore-elements'),
1555 + 'type' => Controls_Manager::DIMENSIONS,
1556 + 'size_units' => ['px', 'em', '%'],
1557 + 'selectors' => [
1558 + '{{WRAPPER}} .ui-e-readmore' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1559 + ],
1560 + ]
1561 + );
1542 1562
1543 - $this->add_group_control(
1544 - Group_Control_Box_Shadow::get_type(),
1545 - [
1546 - 'name' => 'readmore_shadow',
1547 - 'selector' => '{{WRAPPER}} .ui-e-readmore',
1548 - ]
1549 - );
1563 + $this->add_group_control(
1564 + Group_Control_Box_Shadow::get_type(),
1565 + [
1566 + 'name' => 'readmore_shadow',
1567 + 'selector' => '{{WRAPPER}} .ui-e-readmore',
1568 + ]
1569 + );
1550 1570
1551 - $this->end_controls_tab();
1571 + $this->end_controls_tab();
1552 1572
1553 - $this->start_controls_tab(
1554 - 'tab_readmore_box_hover',
1555 - [
1556 - 'label' => esc_html__('Box hover', 'uicore-elements'),
1557 - ]
1558 - );
1573 + $this->start_controls_tab(
1574 + 'tab_readmore_box_hover',
1575 + [
1576 + 'label' => esc_html__('Box hover', 'uicore-elements'),
1577 + ]
1578 + );
1559 1579
1560 - $this->add_control(
1561 - 'readmore_box_hover_text_color',
1562 - [
1563 - 'label' => esc_html__('Color', 'uicore-elements'),
1564 - 'type' => Controls_Manager::COLOR,
1565 - 'selectors' => [
1566 - '{{WRAPPER}}:hover .ui-e-readmore' => 'color: {{VALUE}};',
1567 - '{{WRAPPER}}:hover .ui-e-readmore svg' => 'fill: {{VALUE}};',
1568 - ],
1569 - ]
1570 - );
1580 + $this->add_control(
1581 + 'readmore_box_hover_text_color',
1582 + [
1583 + 'label' => esc_html__('Color', 'uicore-elements'),
1584 + 'type' => Controls_Manager::COLOR,
1585 + 'selectors' => [
1586 + '{{WRAPPER}}:hover .ui-e-readmore' => 'color: {{VALUE}};',
1587 + '{{WRAPPER}}:hover .ui-e-readmore svg' => 'fill: {{VALUE}};',
1588 + ],
1589 + ]
1590 + );
1571 1591
1572 - $this->add_group_control(
1573 - Group_Control_Background::get_type(),
1574 - [
1575 - 'name' => 'readmore_box_hover_background',
1576 - 'selector' => '{{WRAPPER}}:hover .ui-e-readmore',
1577 - ]
1578 - );
1592 + $this->add_group_control(
1593 + Group_Control_Background::get_type(),
1594 + [
1595 + 'name' => 'readmore_box_hover_background',
1596 + 'selector' => '{{WRAPPER}}:hover .ui-e-readmore',
1597 + ]
1598 + );
1579 1599
1580 - $this->add_control(
1581 - 'readmore_box_hover_border_color',
1582 - [
1583 - 'label' => esc_html__('Border Color', 'uicore-elements'),
1584 - 'type' => Controls_Manager::COLOR,
1585 - 'selectors' => [
1586 - '{{WRAPPER}}:hover .ui-e-readmore' => 'border-color: {{VALUE}};',
1587 - ],
1588 - 'condition' => [
1589 - 'readmore_border_border!' => ''
1590 - ]
1591 - ]
1592 - );
1600 + $this->add_control(
1601 + 'readmore_box_hover_border_color',
1602 + [
1603 + 'label' => esc_html__('Border Color', 'uicore-elements'),
1604 + 'type' => Controls_Manager::COLOR,
1605 + 'selectors' => [
1606 + '{{WRAPPER}}:hover .ui-e-readmore' => 'border-color: {{VALUE}};',
1607 + ],
1608 + 'condition' => [
1609 + 'readmore_border_border!' => ''
1610 + ]
1611 + ]
1612 + );
1593 1613
1594 - $this->add_group_control(
1595 - Group_Control_Box_Shadow::get_type(),
1596 - [
1597 - 'name' => 'readmore_box_hover_shadow',
1598 - 'selector' => '{{WRAPPER}}:hover .ui-e-readmore',
1599 - ]
1600 - );
1614 + $this->add_group_control(
1615 + Group_Control_Box_Shadow::get_type(),
1616 + [
1617 + 'name' => 'readmore_box_hover_shadow',
1618 + 'selector' => '{{WRAPPER}}:hover .ui-e-readmore',
1619 + ]
1620 + );
1601 1621
1602 - $this->end_controls_tab();
1622 + $this->end_controls_tab();
1603 1623
1604 - $this->start_controls_tab(
1605 - 'tab_readmore_hover',
1606 - [
1607 - 'label' => esc_html__('Button hover', 'uicore-elements'),
1608 - ]
1609 - );
1624 + $this->start_controls_tab(
1625 + 'tab_readmore_hover',
1626 + [
1627 + 'label' => esc_html__('Button hover', 'uicore-elements'),
1628 + ]
1629 + );
1610 1630
1611 - $this->add_control(
1612 - 'readmore_hover_text_color',
1613 - [
1614 - 'label' => esc_html__('Color', 'uicore-elements'),
1615 - 'type' => Controls_Manager::COLOR,
1616 - 'selectors' => [
1617 - '{{WRAPPER}} .ui-e-readmore:hover' => 'color: {{VALUE}};',
1618 - '{{WRAPPER}} .ui-e-readmore:hover svg' => 'fill: {{VALUE}};',
1619 - ],
1620 - ]
1621 - );
1631 + $this->add_control(
1632 + 'readmore_hover_text_color',
1633 + [
1634 + 'label' => esc_html__('Color', 'uicore-elements'),
1635 + 'type' => Controls_Manager::COLOR,
1636 + 'selectors' => [
1637 + '{{WRAPPER}} .ui-e-readmore:hover' => 'color: {{VALUE}};',
1638 + '{{WRAPPER}} .ui-e-readmore:hover svg' => 'fill: {{VALUE}};',
1639 + ],
1640 + ]
1641 + );
1622 1642
1623 - $this->add_group_control(
1624 - Group_Control_Background::get_type(),
1625 - [
1626 - 'name' => 'readmore_hover_background',
1627 - 'selector' => '{{WRAPPER}} .ui-e-readmore:hover',
1628 - ]
1629 - );
1643 + $this->add_group_control(
1644 + Group_Control_Background::get_type(),
1645 + [
1646 + 'name' => 'readmore_hover_background',
1647 + 'selector' => '{{WRAPPER}} .ui-e-readmore:hover',
1648 + ]
1649 + );
1630 1650
1631 - $this->add_control(
1632 - 'readmore_hover_border_color',
1633 - [
1634 - 'label' => esc_html__('Border Color', 'uicore-elements'),
1635 - 'type' => Controls_Manager::COLOR,
1636 - 'selectors' => [
1637 - '{{WRAPPER}} .ui-e-readmore:hover' => 'border-color: {{VALUE}};',
1638 - ],
1639 - 'condition' => [
1640 - 'readmore_border_border!' => ''
1641 - ]
1642 - ]
1643 - );
1651 + $this->add_control(
1652 + 'readmore_hover_border_color',
1653 + [
1654 + 'label' => esc_html__('Border Color', 'uicore-elements'),
1655 + 'type' => Controls_Manager::COLOR,
1656 + 'selectors' => [
1657 + '{{WRAPPER}} .ui-e-readmore:hover' => 'border-color: {{VALUE}};',
1658 + ],
1659 + 'condition' => [
1660 + 'readmore_border_border!' => ''
1661 + ]
1662 + ]
1663 + );
1644 1664
1645 - $this->add_group_control(
1646 - Group_Control_Box_Shadow::get_type(),
1647 - [
1648 - 'name' => 'readmore_hover_shadow',
1649 - 'selector' => '{{WRAPPER}} .ui-e-readmore:hover',
1650 - ]
1651 - );
1665 + $this->add_group_control(
1666 + Group_Control_Box_Shadow::get_type(),
1667 + [
1668 + 'name' => 'readmore_hover_shadow',
1669 + 'selector' => '{{WRAPPER}} .ui-e-readmore:hover',
1670 + ]
1671 + );
1652 1672
1653 - $this->add_control(
1654 - 'readmore_hover_animation',
1655 - [
1656 - 'label' => esc_html__('Hover Animation', 'uicore-elements'),
1657 - 'type' => Controls_Manager::HOVER_ANIMATION,
1658 - ]
1659 - );
1673 + $this->add_control(
1674 + 'readmore_hover_animation',
1675 + [
1676 + 'label' => esc_html__('Hover Animation', 'uicore-elements'),
1677 + 'type' => Controls_Manager::HOVER_ANIMATION,
1678 + ]
1679 + );
1660 1680
1661 - $this->end_controls_tab();
1681 + $this->end_controls_tab();
1662 1682
1663 - $this->end_controls_tabs();
1683 + $this->end_controls_tabs();
1664 1684
1665 - $this->end_controls_section();
1685 + $this->end_controls_section();
1666 1686
1667 - $this->start_controls_section(
1668 - 'section_style_badge',
1669 - [
1670 - 'label' => esc_html__('Badge', 'uicore-elements'),
1671 - 'tab' => Controls_Manager::TAB_STYLE,
1672 - 'condition' => [
1673 - 'badge' => 'yes',
1674 - ],
1675 - ]
1676 - );
1687 + $this->start_controls_section(
1688 + 'section_style_badge',
1689 + [
1690 + 'label' => esc_html__('Badge', 'uicore-elements'),
1691 + 'tab' => Controls_Manager::TAB_STYLE,
1692 + 'condition' => [
1693 + 'badge' => 'yes',
1694 + ],
1695 + ]
1696 + );
1677 1697
1678 - $this->add_control(
1679 - 'badge_position',
1680 - [
1681 - 'label' => esc_html__('Position', 'uicore-elements'),
1682 - 'type' => Controls_Manager::SELECT,
1683 - 'default' => 'start right',
1684 - 'options' => [
1685 - 'start left' => esc_html__('Top Left', 'uicore-elements'),
1686 - 'start center' => esc_html__('Top Center', 'uicore-elements'),
1687 - 'start right' => esc_html__('Top Right', 'uicore-elements'),
1688 - 'center ' => esc_html__('Center', 'uicore-elements'),
1689 - 'center left' => esc_html__('Center Left', 'uicore-elements'),
1690 - 'center right' => esc_html__('Center Right', 'uicore-elements'),
1691 - 'end left' => esc_html__('Bottom Left', 'uicore-elements'),
1692 - 'end center' => esc_html__('Bottom Center', 'uicore-elements'),
1693 - 'end right' => esc_html__('Bottom Right', 'uicore-elements'),
1694 - ],
1695 - 'selectors' => [
1696 - '{{WRAPPER}} .ui-e-badge-wrp' => '--ui-e-badge-position: {{VALUE}}',
1697 - ]
1698 - ]
1699 - );
1698 + $this->add_control(
1699 + 'badge_position',
1700 + [
1701 + 'label' => esc_html__('Position', 'uicore-elements'),
1702 + 'type' => Controls_Manager::SELECT,
1703 + 'default' => 'start right',
1704 + 'options' => [
1705 + 'start left' => esc_html__('Top Left', 'uicore-elements'),
1706 + 'start center' => esc_html__('Top Center', 'uicore-elements'),
1707 + 'start right' => esc_html__('Top Right', 'uicore-elements'),
1708 + 'center ' => esc_html__('Center', 'uicore-elements'),
1709 + 'center left' => esc_html__('Center Left', 'uicore-elements'),
1710 + 'center right' => esc_html__('Center Right', 'uicore-elements'),
1711 + 'end left' => esc_html__('Bottom Left', 'uicore-elements'),
1712 + 'end center' => esc_html__('Bottom Center', 'uicore-elements'),
1713 + 'end right' => esc_html__('Bottom Right', 'uicore-elements'),
1714 + ],
1715 + 'selectors' => [
1716 + '{{WRAPPER}} .ui-e-badge-wrp' => '--ui-e-badge-position: {{VALUE}}',
1717 + ]
1718 + ]
1719 + );
1700 1720
1701 - $this->add_responsive_control(
1702 - 'badge_horizontal_offset',
1703 - [
1704 - 'label' => esc_html__('Horizontal Offset', 'uicore-elements'),
1705 - 'type' => Controls_Manager::SLIDER,
1706 - 'default' => [
1707 - 'size' => 0,
1708 - ],
1709 - 'tablet_default' => [
1710 - 'size' => 0,
1711 - ],
1712 - 'mobile_default' => [
1713 - 'size' => 0,
1714 - ],
1715 - 'range' => [
1716 - 'px' => [
1717 - 'min' => -300,
1718 - 'step' => 2,
1719 - 'max' => 300,
1720 - ],
1721 - ],
1722 - 'selectors' => [
1723 - '{{WRAPPER}} .ui-e-badge-wrp' => '--ui-e-badge-horizontal-off: {{SIZE}}px;'
1724 - ],
1725 - ]
1726 - );
1721 + $this->add_responsive_control(
1722 + 'badge_horizontal_offset',
1723 + [
1724 + 'label' => esc_html__('Horizontal Offset', 'uicore-elements'),
1725 + 'type' => Controls_Manager::SLIDER,
1726 + 'default' => [
1727 + 'size' => 0,
1728 + ],
1729 + 'tablet_default' => [
1730 + 'size' => 0,
1731 + ],
1732 + 'mobile_default' => [
1733 + 'size' => 0,
1734 + ],
1735 + 'range' => [
1736 + 'px' => [
1737 + 'min' => -300,
1738 + 'step' => 2,
1739 + 'max' => 300,
1740 + ],
1741 + ],
1742 + 'selectors' => [
1743 + '{{WRAPPER}} .ui-e-badge-wrp' => '--ui-e-badge-horizontal-off: {{SIZE}}px;'
1744 + ],
1745 + ]
1746 + );
1727 1747
1728 - $this->add_responsive_control(
1729 - 'badge_vertical_offset',
1730 - [
1731 - 'label' => esc_html__('Vertical Offset', 'uicore-elements'),
1732 - 'type' => Controls_Manager::SLIDER,
1733 - 'default' => [
1734 - 'size' => 0,
1735 - ],
1736 - 'tablet_default' => [
1737 - 'size' => 0,
1738 - ],
1739 - 'mobile_default' => [
1740 - 'size' => 0,
1741 - ],
1742 - 'range' => [
1743 - 'px' => [
1744 - 'min' => -300,
1745 - 'step' => 2,
1746 - 'max' => 300,
1747 - ],
1748 - ],
1749 - 'selectors' => [
1750 - '{{WRAPPER}} .ui-e-badge-wrp' => '--ui-e-badge-vertical-off: {{SIZE}}px;',
1751 - ],
1752 - ]
1753 - );
1748 + $this->add_responsive_control(
1749 + 'badge_vertical_offset',
1750 + [
1751 + 'label' => esc_html__('Vertical Offset', 'uicore-elements'),
1752 + 'type' => Controls_Manager::SLIDER,
1753 + 'default' => [
1754 + 'size' => 0,
1755 + ],
1756 + 'tablet_default' => [
1757 + 'size' => 0,
1758 + ],
1759 + 'mobile_default' => [
1760 + 'size' => 0,
1761 + ],
1762 + 'range' => [
1763 + 'px' => [
1764 + 'min' => -300,
1765 + 'step' => 2,
1766 + 'max' => 300,
1767 + ],
1768 + ],
1769 + 'selectors' => [
1770 + '{{WRAPPER}} .ui-e-badge-wrp' => '--ui-e-badge-vertical-off: {{SIZE}}px;',
1771 + ],
1772 + ]
1773 + );
1754 1774
1755 - $this->add_responsive_control(
1756 - 'badge_rotate',
1757 - [
1758 - 'label' => esc_html__('Rotate', 'uicore-elements'),
1759 - 'type' => Controls_Manager::SLIDER,
1760 - 'devices' => ['desktop', 'tablet', 'mobile'],
1761 - 'default' => [
1762 - 'size' => 0,
1763 - ],
1764 - 'tablet_default' => [
1765 - 'size' => 0,
1766 - ],
1767 - 'mobile_default' => [
1768 - 'size' => 0,
1769 - ],
1770 - 'range' => [
1771 - 'px' => [
1772 - 'min' => -360,
1773 - 'max' => 360,
1774 - 'step' => 5,
1775 - ],
1776 - ],
1777 - 'selectors' => [
1778 - '{{WRAPPER}} .ui-e-badge' => 'rotate: {{SIZE}}deg;'
1779 - ],
1780 - ]
1781 - );
1775 + $this->add_responsive_control(
1776 + 'badge_rotate',
1777 + [
1778 + 'label' => esc_html__('Rotate', 'uicore-elements'),
1779 + 'type' => Controls_Manager::SLIDER,
1780 + 'devices' => ['desktop', 'tablet', 'mobile'],
1781 + 'default' => [
1782 + 'size' => 0,
1783 + ],
1784 + 'tablet_default' => [
1785 + 'size' => 0,
1786 + ],
1787 + 'mobile_default' => [
1788 + 'size' => 0,
1789 + ],
1790 + 'range' => [
1791 + 'px' => [
1792 + 'min' => -360,
1793 + 'max' => 360,
1794 + 'step' => 5,
1795 + ],
1796 + ],
1797 + 'selectors' => [
1798 + '{{WRAPPER}} .ui-e-badge' => 'rotate: {{SIZE}}deg;'
1799 + ],
1800 + ]
1801 + );
1782 1802
1783 1803 $this->start_controls_tabs('tabs_badge');
1784 1804
1785 - $this->start_controls_tab(
1786 - 'tab_badge_style_normal',
1787 - [
1788 - 'label' => esc_html__('Normal', 'uicore-elements'),
1789 - ]
1790 - );
1805 + $this->start_controls_tab(
1806 + 'tab_badge_style_normal',
1807 + [
1808 + 'label' => esc_html__('Normal', 'uicore-elements'),
1809 + ]
1810 + );
1791 1811
1792 - $this->add_group_control(
1793 - Group_Control_Typography::get_type(),
1794 - [
1795 - 'name' => 'badge_typography',
1796 - 'selector' => '{{WRAPPER}} .ui-e-badge',
1797 - 'fields_options' => [
1798 - 'font_size' => [
1799 - 'default' => [
1800 - 'unit' => 'px',
1801 - 'size' => 12,
1802 - ],
1803 - ],
1804 - 'line_height' => [
1805 - 'default' => [
1806 - 'unit' => 'em',
1807 - 'size' => 1,
1808 - ],
1809 - ],
1812 + $this->add_group_control(
1813 + Group_Control_Typography::get_type(),
1814 + [
1815 + 'name' => 'badge_typography',
1816 + 'selector' => '{{WRAPPER}} .ui-e-badge',
1817 + 'fields_options' => [
1818 + 'font_size' => [
1819 + 'default' => [
1820 + 'unit' => 'px',
1821 + 'size' => 12,
1810 1822 ],
1811 - ]
1812 - );
1823 + ],
1824 + 'line_height' => [
1825 + 'default' => [
1826 + 'unit' => 'em',
1827 + 'size' => 1,
1828 + ],
1829 + ],
1830 + ],
1831 + ]
1832 + );
1813 1833
1814 - $this->add_control(
1815 - 'badge_text_color',
1816 - [
1817 - 'label' => esc_html__('Text Color', 'uicore-elements'),
1818 - 'type' => Controls_Manager::COLOR,
1819 - 'selectors' => [
1820 - '{{WRAPPER}} .ui-e-badge' => 'color: {{VALUE}};',
1821 - ],
1822 - ]
1823 - );
1834 + $this->add_control(
1835 + 'badge_text_color',
1836 + [
1837 + 'label' => esc_html__('Text Color', 'uicore-elements'),
1838 + 'type' => Controls_Manager::COLOR,
1839 + 'selectors' => [
1840 + '{{WRAPPER}} .ui-e-badge' => 'color: {{VALUE}};',
1841 + ],
1842 + ]
1843 + );
1824 1844
1825 - $this->add_group_control(
1826 - Group_Control_Background::get_type(),
1827 - [
1828 - 'name' => 'badge_background',
1829 - 'selector' => '{{WRAPPER}} .ui-e-badge',
1830 - ]
1831 - );
1845 + $this->add_group_control(
1846 + Group_Control_Background::get_type(),
1847 + [
1848 + 'name' => 'badge_background',
1849 + 'selector' => '{{WRAPPER}} .ui-e-badge',
1850 + ]
1851 + );
1832 1852
1833 - $this->add_group_control(
1834 - Group_Control_Border::get_type(),
1835 - [
1836 - 'name' => 'badge_border',
1837 - 'placeholder' => '1px',
1838 - 'default' => '1px',
1839 - 'selector' => '{{WRAPPER}} .ui-e-badge'
1840 - ]
1841 - );
1853 + $this->add_group_control(
1854 + Group_Control_Border::get_type(),
1855 + [
1856 + 'name' => 'badge_border',
1857 + 'placeholder' => '1px',
1858 + 'default' => '1px',
1859 + 'selector' => '{{WRAPPER}} .ui-e-badge'
1860 + ]
1861 + );
1842 1862
1843 - $this->add_responsive_control(
1844 - 'badge_radius',
1845 - [
1846 - 'label' => esc_html__('Border Radius', 'uicore-elements'),
1847 - 'type' => Controls_Manager::DIMENSIONS,
1848 - 'size_units' => ['px', '%'],
1849 - 'default' => [
1850 - 'top' => 10,
1851 - 'right' => 10,
1852 - 'bottom' => 10,
1853 - 'left' => 10,
1854 - 'unit' => 'px',
1855 - 'isLinked' => true,
1856 - ],
1857 - 'selectors' => [
1858 - '{{WRAPPER}} .ui-e-badge' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1859 - ],
1860 - ]
1861 - );
1863 + $this->add_responsive_control(
1864 + 'badge_radius',
1865 + [
1866 + 'label' => esc_html__('Border Radius', 'uicore-elements'),
1867 + 'type' => Controls_Manager::DIMENSIONS,
1868 + 'size_units' => ['px', '%'],
1869 + 'default' => [
1870 + 'top' => 10,
1871 + 'right' => 10,
1872 + 'bottom' => 10,
1873 + 'left' => 10,
1874 + 'unit' => 'px',
1875 + 'isLinked' => true,
1876 + ],
1877 + 'selectors' => [
1878 + '{{WRAPPER}} .ui-e-badge' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1879 + ],
1880 + ]
1881 + );
1862 1882
1863 - $this->add_responsive_control(
1864 - 'badge_padding',
1865 - [
1866 - 'label' => esc_html__('Padding', 'uicore-elements'),
1867 - 'type' => Controls_Manager::DIMENSIONS,
1868 - 'size_units' => ['px', 'em', '%'],
1869 - 'default' => [
1870 - 'top' => '8',
1871 - 'right' => '12',
1872 - 'bottom' => '8',
1873 - 'left' => '12',
1874 - 'unit' => 'px',
1875 - 'isLinked' => false,
1876 - ],
1877 - 'selectors' => [
1878 - '{{WRAPPER}} .ui-e-badge' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1879 - ],
1880 - ]
1881 - );
1883 + $this->add_responsive_control(
1884 + 'badge_padding',
1885 + [
1886 + 'label' => esc_html__('Padding', 'uicore-elements'),
1887 + 'type' => Controls_Manager::DIMENSIONS,
1888 + 'size_units' => ['px', 'em', '%'],
1889 + 'default' => [
1890 + 'top' => '8',
1891 + 'right' => '12',
1892 + 'bottom' => '8',
1893 + 'left' => '12',
1894 + 'unit' => 'px',
1895 + 'isLinked' => false,
1896 + ],
1897 + 'selectors' => [
1898 + '{{WRAPPER}} .ui-e-badge' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1899 + ],
1900 + ]
1901 + );
1882 1902
1883 - $this->add_group_control(
1884 - Group_Control_Box_Shadow::get_type(),
1885 - [
1886 - 'name' => 'badge_shadow',
1887 - 'selector' => '{{WRAPPER}} .ui-e-badge',
1888 - ]
1889 - );
1903 + $this->add_group_control(
1904 + Group_Control_Box_Shadow::get_type(),
1905 + [
1906 + 'name' => 'badge_shadow',
1907 + 'selector' => '{{WRAPPER}} .ui-e-badge',
1908 + ]
1909 + );
1890 1910
1891 1911
1892 - $this->end_controls_tab();
1912 + $this->end_controls_tab();
1893 1913
1894 - $this->start_controls_tab(
1895 - 'tab_badge_style_hover',
1896 - [
1897 - 'label' => esc_html__('Hover', 'uicore-elements'),
1898 - ]
1899 - );
1914 + $this->start_controls_tab(
1915 + 'tab_badge_style_hover',
1916 + [
1917 + 'label' => esc_html__('Hover', 'uicore-elements'),
1918 + ]
1919 + );
1900 1920
1901 - $this->add_control(
1902 - 'badge_text_hover_color',
1903 - [
1904 - 'label' => esc_html__('Text Color', 'uicore-elements'),
1905 - 'type' => Controls_Manager::COLOR,
1906 - 'selectors' => [
1907 - '{{WRAPPER}}:hover .ui-e-badge' => 'color: {{VALUE}};',
1908 - ],
1909 - ]
1910 - );
1921 + $this->add_control(
1922 + 'badge_text_hover_color',
1923 + [
1924 + 'label' => esc_html__('Text Color', 'uicore-elements'),
1925 + 'type' => Controls_Manager::COLOR,
1926 + 'selectors' => [
1927 + '{{WRAPPER}}:hover .ui-e-badge' => 'color: {{VALUE}};',
1928 + ],
1929 + ]
1930 + );
1911 1931
1912 - $this->add_group_control(
1913 - Group_Control_Background::get_type(),
1914 - [
1915 - 'name' => 'badge_hover_background',
1916 - 'selector' => '{{WRAPPER}}:hover .ui-e-badge',
1917 - ]
1918 - );
1932 + $this->add_group_control(
1933 + Group_Control_Background::get_type(),
1934 + [
1935 + 'name' => 'badge_hover_background',
1936 + 'selector' => '{{WRAPPER}}:hover .ui-e-badge',
1937 + ]
1938 + );
1919 1939
1920 - $this->add_group_control(
1921 - Group_Control_Border::get_type(),
1922 - [
1923 - 'name' => 'badge_hover_border',
1924 - 'placeholder' => '1px',
1925 - 'default' => '1px',
1926 - 'selector' => '{{WRAPPER}}:hover .ui-e-badge'
1927 - ]
1928 - );
1940 + $this->add_group_control(
1941 + Group_Control_Border::get_type(),
1942 + [
1943 + 'name' => 'badge_hover_border',
1944 + 'placeholder' => '1px',
1945 + 'default' => '1px',
1946 + 'selector' => '{{WRAPPER}}:hover .ui-e-badge'
1947 + ]
1948 + );
1929 1949
1930 - $this->add_group_control(
1931 - Group_Control_Box_Shadow::get_type(),
1932 - [
1933 - 'name' => 'badge_hover_shadow',
1934 - 'selector' => '{{WRAPPER}}:hover .ui-e-badge',
1935 - ]
1936 - );
1950 + $this->add_group_control(
1951 + Group_Control_Box_Shadow::get_type(),
1952 + [
1953 + 'name' => 'badge_hover_shadow',
1954 + 'selector' => '{{WRAPPER}}:hover .ui-e-badge',
1955 + ]
1956 + );
1937 1957
1938 - $this->end_controls_tab();
1958 + $this->end_controls_tab();
1939 1959
1940 1960 $this->end_controls_tabs();
1941 1961
1942 - $this->end_controls_section();
1962 + $this->end_controls_section();
1943 1963
1944 - $this->start_controls_section(
1945 - 'section_animation',
1946 - [
1947 - 'label' => esc_html__('Animations', 'uicore-elements'),
1948 - 'tab' => Controls_Manager::TAB_STYLE,
1949 - ]
1950 - );
1964 + $this->start_controls_section(
1965 + 'section_animation',
1966 + [
1967 + 'label' => esc_html__('Animations', 'uicore-elements'),
1968 + 'tab' => Controls_Manager::TAB_STYLE,
1969 + ]
1970 + );
1951 1971
1952 - $this->add_control(
1953 - 'description_animation',
1954 - [
1955 - 'label' => esc_html__( 'Description Hover Animation', 'uicore-elements' ),
1956 - 'type' => \Elementor\Controls_Manager::SELECT,
1957 - 'default' => '',
1958 - 'options' => [
1959 - '' => esc_html__( 'None', 'uicore-elements' ),
1960 - 'ui-e-animation-description-show' => esc_html__( 'Show', 'uicore-elements' ),
1961 - ],
1962 - 'prefix_class' => '',
1963 - 'frontend_available' => true,
1964 - 'conditions' => [
1965 - 'relation' => 'or',
1966 - 'terms' => [
1967 - [
1968 - 'name' => 'position',
1969 - 'operator' => '==',
1970 - 'value' => 'top',
1971 - ],
1972 - [
1973 - 'relation' => 'and',
1974 - 'terms' => [
1975 - [
1976 - 'name' => 'position',
1977 - 'operator' => 'in',
1978 - 'value' => ['left', 'right'],
1979 - ],
1980 - [
1981 - 'name' => 'icon_inline',
1982 - 'operator' => '==',
1983 - 'value' => 'yes',
1984 - ],
1985 - ],
1986 - ],
1987 - ],
1988 - ],
1972 + $this->add_control(
1973 + 'description_animation',
1974 + [
1975 + 'label' => esc_html__('Description Hover Animation', 'uicore-elements'),
1976 + 'type' => \Elementor\Controls_Manager::SELECT,
1977 + 'default' => '',
1978 + 'options' => [
1979 + '' => esc_html__('None', 'uicore-elements'),
1980 + 'ui-e-animation-description-show' => esc_html__('Show', 'uicore-elements'),
1981 + ],
1982 + 'prefix_class' => '',
1983 + 'frontend_available' => true,
1984 + 'conditions' => [
1985 + 'relation' => 'or',
1986 + 'terms' => [
1987 + [
1988 + 'name' => 'position',
1989 + 'operator' => '==',
1990 + 'value' => 'top',
1991 + ],
1992 + [
1993 + 'relation' => 'and',
1994 + 'terms' => [
1995 + [
1996 + 'name' => 'position',
1997 + 'operator' => 'in',
1998 + 'value' => ['left', 'right'],
1999 + ],
2000 + [
2001 + 'name' => 'icon_inline',
2002 + 'operator' => '==',
2003 + 'value' => 'yes',
2004 + ],
2005 + ],
2006 + ],
2007 + ],
2008 + ],
1989 2009
1990 - ]
1991 - );
2010 + ]
2011 + );
1992 2012
1993 - // Creates a prefix if has readmore button AND description animation. This allows us to apply some bottom space to the absolute flex-wrapper, keeping it above readmore
1994 - $this->add_control(
1995 - 'description_prefix',
1996 - [
1997 - 'label' => esc_html__( 'Prefix Class for Description with Readmore', 'uicore-elements' ),
1998 - 'type' => \Elementor\Controls_Manager::HIDDEN,
1999 - 'default' => 'readmore',
2000 - 'condition' => [
2001 - 'readmore' => 'yes',
2002 - 'description_animation' => 'ui-e-animation-description-show',
2003 - ],
2004 - 'prefix_class' => 'ui-e-has-',
2005 - ]
2006 - );
2013 + // Creates a prefix if has readmore button AND description animation. This allows us to apply some bottom space to the absolute flex-wrapper, keeping it above readmore
2014 + $this->add_control(
2015 + 'description_prefix',
2016 + [
2017 + 'label' => esc_html__('Prefix Class for Description with Readmore', 'uicore-elements'),
2018 + 'type' => \Elementor\Controls_Manager::HIDDEN,
2019 + 'default' => 'readmore',
2020 + 'condition' => [
2021 + 'readmore' => 'yes',
2022 + 'description_animation' => 'ui-e-animation-description-show',
2023 + ],
2024 + 'prefix_class' => 'ui-e-has-',
2025 + ]
2026 + );
2007 2027
2008 - $this->add_control(
2009 - 'readmore_animation',
2010 - [
2011 - 'label' => esc_html__( 'Button Hover Animation', 'uicore-elements' ),
2012 - 'type' => \Elementor\Controls_Manager::SELECT,
2013 - 'default' => '',
2014 - 'options' => [
2015 - '' => esc_html__( 'None', 'uicore-elements' ),
2016 - 'ui-e-animation-rm-show' => esc_html__( 'Show', 'uicore-elements' ),
2017 - 'ui-e-animation-rm-ico' => esc_html__( 'Icon', 'uicore-elements' ),
2018 - ],
2019 - 'prefix_class' => '',
2020 - 'frontend_available' => true,
2021 - 'condition' => [
2022 - 'readmore' => 'yes',
2023 - 'position!' => 'bottom',
2024 - ]
2025 - ]
2026 - );
2028 + $this->add_control(
2029 + 'readmore_animation',
2030 + [
2031 + 'label' => esc_html__('Button Hover Animation', 'uicore-elements'),
2032 + 'type' => \Elementor\Controls_Manager::SELECT,
2033 + 'default' => '',
2034 + 'options' => [
2035 + '' => esc_html__('None', 'uicore-elements'),
2036 + 'ui-e-animation-rm-show' => esc_html__('Show', 'uicore-elements'),
2037 + 'ui-e-animation-rm-ico' => esc_html__('Icon', 'uicore-elements'),
2038 + ],
2039 + 'prefix_class' => '',
2040 + 'frontend_available' => true,
2041 + 'condition' => [
2042 + 'readmore' => 'yes',
2043 + 'position!' => 'bottom',
2044 + ]
2045 + ]
2046 + );
2027 2047
2028 - $this->add_control(
2029 - 'icon_animation',
2030 - [
2031 - 'label' => esc_html__('Icon Hover Animation', 'uicore-elements'),
2032 - 'type' => Controls_Manager::SELECT,
2033 - 'prefix_class' => '',
2034 - 'default' => '',
2035 - 'options' => [
2036 - '' => esc_html__('None', 'uicore-elements'),
2037 - 'ui-e-animation-ico-float' => esc_html__('Icon Float', 'uicore-elements'),
2038 - 'ui-e-animation-ico-grow' => esc_html__('Background Circle', 'uicore-elements'),
2039 - 'ui-e-animation-ico-slide' => esc_html__('Background Slide', 'uicore-elements'),
2040 - ],
2041 - 'condition' => [
2042 - 'icon_type!' => 'none',
2043 - ]
2044 - ]
2045 - );
2046 2048 $this->add_control(
2047 - 'icon_animation_background',
2048 - [
2049 - 'label' => esc_html__( 'Color', 'uicore-elements' ),
2050 - 'type' => Controls_Manager::COLOR,
2049 + 'icon_animation',
2050 + [
2051 + 'label' => esc_html__('Icon Hover Animation', 'uicore-elements'),
2052 + 'type' => Controls_Manager::SELECT,
2053 + 'prefix_class' => '',
2054 + 'default' => '',
2055 + 'options' => [
2056 + '' => esc_html__('None', 'uicore-elements'),
2057 + 'ui-e-animation-ico-float' => esc_html__('Icon Float', 'uicore-elements'),
2058 + 'ui-e-animation-ico-grow' => esc_html__('Background Circle', 'uicore-elements'),
2059 + 'ui-e-animation-ico-slide' => esc_html__('Background Slide', 'uicore-elements'),
2060 + ],
2061 + 'condition' => [
2062 + 'icon_type!' => 'none',
2063 + ]
2064 + ]
2065 + );
2066 + $this->add_control(
2067 + 'icon_animation_background',
2068 + [
2069 + 'label' => esc_html__('Color', 'uicore-elements'),
2070 + 'type' => Controls_Manager::COLOR,
2051 2071 'condition' => [
2052 2072 'icon_animation' => [
2053 2073 'ui-e-animation-ico-grow',
2054 2074 'ui-e-animation-ico-slide'
@@ -2053,243 +2073,245 @@
2053 2073 'ui-e-animation-ico-grow',
2054 2074 'ui-e-animation-ico-slide'
2055 2075 ]
2056 2076 ],
2057 - 'selectors' => [
2058 - '{{WRAPPER}}:hover .ui-e-icon-wrp:after' => 'background-color: {{VALUE}}',
2059 - ],
2060 - ]
2061 - );
2077 + 'selectors' => [
2078 + '{{WRAPPER}}:hover .ui-e-icon-wrp:after' => 'background-color: {{VALUE}}',
2079 + ],
2080 + ]
2081 + );
2062 2082
2063 - $this->add_control(
2064 - 'widget_animation',
2065 - [
2066 - 'label' => esc_html__( 'Item Hover Animation', 'uicore-elements' ),
2067 - 'type' => \Elementor\Controls_Manager::SELECT,
2068 - 'default' => '',
2069 - 'options' => [
2070 - '' => esc_html__( 'None', 'uicore-elements' ),
2071 - 'ui-e-animation-widget-zoom' => esc_html__( 'Zoom', 'uicore-elements' ),
2072 - 'ui-e-animation-widget-translate' => esc_html__( 'Translate', 'uicore-elements' ),
2073 - ],
2074 - 'prefix_class' => '',
2075 - ]
2076 - );
2083 + $this->add_control(
2084 + 'widget_animation',
2085 + [
2086 + 'label' => esc_html__('Item Hover Animation', 'uicore-elements'),
2087 + 'type' => \Elementor\Controls_Manager::SELECT,
2088 + 'default' => '',
2089 + 'options' => [
2090 + '' => esc_html__('None', 'uicore-elements'),
2091 + 'ui-e-animation-widget-zoom' => esc_html__('Zoom', 'uicore-elements'),
2092 + 'ui-e-animation-widget-translate' => esc_html__('Translate', 'uicore-elements'),
2093 + ],
2094 + 'prefix_class' => '',
2095 + ]
2096 + );
2077 2097
2078 - $this->add_control(
2079 - 'widget_animation_zoom',
2080 - [
2081 - 'label' => esc_html__( 'Zoom scale', 'uicore-elements' ),
2082 - 'type' => \Elementor\Controls_Manager::SLIDER,
2083 - 'size_units' => ['px'],
2084 - 'range' => [
2085 - 'px' => [
2086 - 'min' => .8,
2087 - 'max' => 1.3,
2088 - 'step' => 0.01,
2089 - ],
2090 - ],
2091 - 'default' => [
2092 - 'unit' => 'px',
2093 - 'size' => 1.12,
2094 - ],
2095 - 'condition' =>[
2096 - 'widget_animation' => 'ui-e-animation-widget-zoom',
2097 - ],
2098 - 'selectors' => [
2099 - '{{WRAPPER}}' => '--ui-e-ico-box-widget-zoom: {{SIZE}}',
2100 - ],
2101 - ]
2102 - );
2098 + $this->add_control(
2099 + 'widget_animation_zoom',
2100 + [
2101 + 'label' => esc_html__('Zoom scale', 'uicore-elements'),
2102 + 'type' => \Elementor\Controls_Manager::SLIDER,
2103 + 'size_units' => ['px'],
2104 + 'range' => [
2105 + 'px' => [
2106 + 'min' => .8,
2107 + 'max' => 1.3,
2108 + 'step' => 0.01,
2109 + ],
2110 + ],
2111 + 'default' => [
2112 + 'unit' => 'px',
2113 + 'size' => 1.12,
2114 + ],
2115 + 'condition' => [
2116 + 'widget_animation' => 'ui-e-animation-widget-zoom',
2117 + ],
2118 + 'selectors' => [
2119 + '{{WRAPPER}}' => '--ui-e-ico-box-widget-zoom: {{SIZE}}',
2120 + ],
2121 + ]
2122 + );
2103 2123
2104 - $this->add_control(
2105 - 'widget_animation_translate',
2106 - [
2107 - 'label' => esc_html__( 'Translate value', 'uicore-elements' ),
2108 - 'type' => \Elementor\Controls_Manager::SLIDER,
2109 - 'size_units' => ['px'],
2110 - 'range' => [
2111 - 'px' => [
2112 - 'min' => -50,
2113 - 'max' => 50,
2114 - 'step' => 1,
2115 - ],
2116 - ],
2117 - 'default' => [
2118 - 'unit' => 'px',
2119 - 'size' => -36,
2120 - ],
2121 - 'condition' =>[
2122 - 'widget_animation' => 'ui-e-animation-widget-translate',
2123 - ],
2124 - 'selectors' => [
2125 - '{{WRAPPER}}' => '--ui-e-ico-box-widget-translate: {{SIZE}}{{UNIT}}',
2126 - ],
2127 - ]
2128 - );
2124 + $this->add_control(
2125 + 'widget_animation_translate',
2126 + [
2127 + 'label' => esc_html__('Translate value', 'uicore-elements'),
2128 + 'type' => \Elementor\Controls_Manager::SLIDER,
2129 + 'size_units' => ['px'],
2130 + 'range' => [
2131 + 'px' => [
2132 + 'min' => -50,
2133 + 'max' => 50,
2134 + 'step' => 1,
2135 + ],
2136 + ],
2137 + 'default' => [
2138 + 'unit' => 'px',
2139 + 'size' => -36,
2140 + ],
2141 + 'condition' => [
2142 + 'widget_animation' => 'ui-e-animation-widget-translate',
2143 + ],
2144 + 'selectors' => [
2145 + '{{WRAPPER}}' => '--ui-e-ico-box-widget-translate: {{SIZE}}{{UNIT}}',
2146 + ],
2147 + ]
2148 + );
2129 2149
2130 - $this->end_controls_section();
2150 + $this->end_controls_section();
2131 2151
2132 - $this->start_controls_section(
2133 - 'section_style_additional',
2134 - [
2135 - 'label' => esc_html__('Additional', 'uicore-elements'),
2136 - 'tab' => Controls_Manager::TAB_STYLE,
2137 - ]
2138 - );
2152 + $this->start_controls_section(
2153 + 'section_style_additional',
2154 + [
2155 + 'label' => esc_html__('Additional', 'uicore-elements'),
2156 + 'tab' => Controls_Manager::TAB_STYLE,
2157 + ]
2158 + );
2139 2159
2140 - $this->add_responsive_control(
2141 - 'content_padding',
2142 - [
2143 - 'label' => esc_html__('Content Inner Padding', 'uicore-elements'),
2144 - 'type' => Controls_Manager::DIMENSIONS,
2145 - 'size_units' => ['px', 'em', '%'],
2146 - 'frontend_available' => true,
2147 - 'selectors' => [
2148 - '{{WRAPPER}} .ui-e-ico-box' => '--ui-e-content-padding-top: {{TOP}}{{UNIT}};
2160 + $this->add_responsive_control(
2161 + 'content_padding',
2162 + [
2163 + 'label' => esc_html__('Content Inner Padding', 'uicore-elements'),
2164 + 'type' => Controls_Manager::DIMENSIONS,
2165 + 'size_units' => ['px', 'em', '%'],
2166 + 'frontend_available' => true,
2167 + 'selectors' => [
2168 + '{{WRAPPER}} .ui-e-ico-box' => '--ui-e-content-padding-top: {{TOP}}{{UNIT}};
2149 2169 --ui-e-content-padding-right: {{RIGHT}}{{UNIT}};
2150 2170 --ui-e-content-padding-bot: {{BOTTOM}}{{UNIT}};
2151 2171 --ui-e-content-padding-left: {{LEFT}}{{UNIT}};'
2152 - ]
2153 - ]
2154 - );
2172 + ]
2173 + ]
2174 + );
2155 2175
2156 - $this->end_controls_section();
2157 - }
2158 - protected function render()
2159 - {
2160 - $settings = $this->get_settings_for_display();
2176 + $this->end_controls_section();
2177 + }
2178 + protected function render()
2179 + {
2180 + $settings = $this->get_settings_for_display();
2161 2181
2162 - // Get the proper media
2163 - $media_type = $settings['icon_type'];
2164 - switch($media_type) {
2182 + // Get the proper media
2183 + $media_type = $settings['icon_type'];
2184 + switch ($media_type) {
2165 2185
2166 - case 'icon' :
2167 - $media = $settings['selected_icon'];
2168 - break;
2186 + case 'icon':
2187 + $media = $settings['selected_icon'];
2188 + break;
2169 2189
2170 - case 'image' :
2171 - $media = $settings['image'];
2172 - $media_size = isset($settings['image_fullwidth']) ? 'large' : 'medium'; // Gets the proper media size.
2173 - break;
2174 - }
2190 + case 'image':
2191 + $media = $settings['image'];
2192 + $media_size = isset($settings['image_fullwidth']) ? 'large' : 'medium'; // Gets the proper media size.
2193 + break;
2194 + }
2175 2195
2176 - // Build the title
2177 - if (! empty($settings['title_link_url']['url'])){
2196 + // Build the title
2197 + if (! empty($settings['title_link_url']['url'])) {
2178 2198
2179 - $hasTitleUrl = true;
2180 - $this->add_link_attributes( 'title_link', $settings['title_link_url'] );
2181 - $titleUrl = "<a {$this->get_render_attribute_string( 'title_link')}>";
2199 + $hasTitleUrl = true;
2200 + $this->add_link_attributes('title_link', $settings['title_link_url']);
2201 + $titleUrl = "<a {$this->get_render_attribute_string('title_link')}>";
2202 + } else {
2203 + $hasTitleUrl = false;
2204 + }
2182 2205
2183 - } else { $hasTitleUrl = false;}
2206 + $title = '<' . Helper::esc_tag($settings['title_size']) . ' class="ui-e-title">';
2207 + $title .= $hasTitleUrl ? wp_kses_post($titleUrl) : ''; // url
2208 + $title .= esc_html($settings['title_text']);
2209 + $title .= $hasTitleUrl ? '</a>' : ''; // url closure
2210 + $title .= '</' . Helper::esc_tag($settings['title_size']) . '>';
2184 2211
2185 - $title = '<'.esc_html($settings['title_size']).' class="ui-e-title">';
2186 - $title .= $hasTitleUrl ? wp_kses_post($titleUrl) : ''; // url
2187 - $title .= esc_html($settings['title_text']);
2188 - $title .= $hasTitleUrl ? '</a>' : ''; // url closure
2189 - $title .= '</'.esc_html($settings['title_size']).'>';
2212 + // Build the global Url
2213 + if ($settings['global_link'] && $settings['global_link_url']['url'] && !$this->is_edit_mode()) {
2190 2214
2191 - // Build the global Url
2192 - if($settings['global_link'] && $settings['global_link_url']['url'] && !$this->is_edit_mode()){
2215 + $global_target = $settings['global_link_url']['is_external'] ? '_blank' : '_self';
2216 + $this->add_render_attribute('global_link', 'onclick', "window.open('{$settings['global_link_url']['url']}', '$global_target')");
2217 + }
2193 2218
2194 - $global_target = $settings['global_link_url']['is_external'] ? '_blank' : '_self';
2195 - $this->add_render_attribute('global_link', 'onclick', "window.open('{$settings['global_link_url']['url']}', '$global_target')");
2196 - }
2219 + // Build the subtitle
2220 + $subtitle = $settings['sub_title_text'] != '' ? "<div class='ui-e-subtitle'> {$settings['sub_title_text']} </div>" : '';
2197 2221
2198 - // Build the subtitle
2199 - $subtitle = $settings['sub_title_text'] != '' ? "<div class='ui-e-subtitle'> {$settings['sub_title_text']} </div>" : '';
2222 + // Build the readmore
2223 + $readmore = $settings['readmore'];
2224 + if ($readmore) {
2200 2225
2201 - // Build the readmore
2202 - $readmore = $settings['readmore'];
2203 - if($readmore){
2226 + $rmContent = $settings['readmore_text'];
2227 + $rmIcon = $settings['readmore_icon']['value'] == '' ? false : true;
2204 2228
2205 - $rmContent = $settings['readmore_text'];
2206 - $rmIcon = $settings['readmore_icon']['value'] == '' ? false : true;
2229 + if (!empty($settings['readmore_link']['url'])) {
2207 2230
2208 - if(!empty($settings['readmore_link']['url'])){
2231 + $this->add_link_attributes('rm_link', $settings['readmore_link']);
2232 + }
2209 2233
2210 - $this->add_link_attributes( 'rm_link', $settings['readmore_link']);
2211 - }
2234 + $this->add_render_attribute('rm_atts', 'class', $settings['readmore_hover_animation'] ? 'ui-e-readmore elementor-animation-' . esc_attr($settings['readmore_hover_animation']) : 'ui-e-readmore');
2212 2235
2213 - $this->add_render_attribute('rm_atts', 'class', $settings['readmore_hover_animation'] ? 'ui-e-readmore elementor-animation-'.esc_attr($settings['readmore_hover_animation']) : 'ui-e-readmore');
2236 + if (!empty($settings['button_css_id'])) {
2237 + $this->add_render_attribute('rm_atts', 'id', esc_attr($settings['button_css_id']));
2238 + }
2214 2239
2215 - if (!empty($settings['button_css_id'])) {
2216 - $this->add_render_attribute( 'rm_atts', 'id', esc_attr($settings['button_css_id']) );
2217 - }
2240 + // if ($settings['onclick']) {
2241 + // $this->add_render_attribute( 'rm_atts', 'onclick', esc_js($settings['onclick_event']) );
2242 + // }
2243 + };
2244 + // Check the icon position and sets the inline (true puts title/subtitlte inside flex wrapper, false puts inside content)
2245 + switch ($settings['position']) {
2218 2246
2219 - // if ($settings['onclick']) {
2220 - // $this->add_render_attribute( 'rm_atts', 'onclick', esc_js($settings['onclick_event']) );
2221 - // }
2222 - }
2247 + // Always true if top; always false if bottom and left/right checks the user choice
2248 + case 'top':
2249 + $inline = true;
2250 + break;
2223 2251
2224 - // Check the icon position and sets the inline (true puts title/subtitlte inside flex wrapper, false puts inside content)
2225 - switch($settings['position']){
2252 + case 'bottom':
2253 + $inline = false;
2254 + break;
2226 2255
2227 - // Always true if top; always false if bottom and left/right checks the user choice
2228 - case 'top' :
2229 - $inline = true;
2230 - break;
2256 + default:
2257 + $inline = $this->is_option('icon_inline', 'yes');
2258 + break;
2259 + }
2231 2260
2232 - case 'bottom' :
2233 - $inline = false;
2234 - break;
2261 +?>
2235 2262
2236 - default :
2237 - $inline = $settings['icon_inline'] === 'yes' ? true : false;
2238 - break;
2239 - }
2263 + <div class="ui-e-ico-box" <?php $this->print_render_attribute_string('global_link'); ?>>
2240 2264
2241 - ?>
2265 + <?php if ($settings['badge']) : ?>
2266 + <span class="ui-e-badge-wrp">
2267 + <?php $position = isset($settings['badge_position']) ? $settings['badge_position'] : 'start right'; // TODO: default start right value is not printed for some reason
2268 + ?>
2269 + <span class="ui-e-badge <?php echo esc_attr($position); ?>"> <?php echo esc_html($settings['badge_text']); ?> </span>
2270 + </span>
2271 + <?php endif; ?>
2242 2272
2243 - <div class="ui-e-ico-box" <?php $this->print_render_attribute_string('global_link');?>>
2273 + <div class='ui-e-flex-wrp'>
2244 2274
2245 - <?php if($settings['badge']) : ?>
2246 - <span class="ui-e-badge-wrp">
2247 - <span class="ui-e-badge ui-e-<?php echo esc_attr($settings['badge_position']);?>"> <?php echo esc_html($settings['badge_text']);?> </span>
2248 - </span>
2249 - <?php endif; ?>
2275 + <?php if ($media_type != 'none') : ?>
2276 + <div class="ui-e-icon-wrp">
2250 2277
2251 - <div class='ui-e-flex-wrp'>
2278 + <?php if ($media_type == 'icon') {
2279 + Icons_Manager::render_icon($media, ['aria-hidden' => 'true']);
2280 + } else {
2281 + echo wp_get_attachment_image($media['id'], $media_size);
2282 + }
2283 + ?>
2252 2284
2253 - <?php if($media_type != 'none') : ?>
2254 - <div class="ui-e-icon-wrp">
2285 + </div>
2286 + <?php endif; ?>
2255 2287
2256 - <?php if ($media_type == 'icon') {
2257 - Icons_Manager::render_icon( $media, [ 'aria-hidden' => 'true' ] );
2258 - } else {
2259 - echo wp_get_attachment_image( $media['id'], $media_size );
2260 - }
2261 - ?>
2288 + <?php echo $inline ? '<div class="ui-e-title-wrp">' . wp_kses_post($title . $subtitle) . '</div>' : ''; ?>
2262 2289
2263 - </div>
2264 - <?php endif; ?>
2290 + </div>
2265 2291
2266 - <?php echo $inline ? '<div class="ui-e-title-wrp">' . wp_kses_post($title . $subtitle) . '</div>' : '' ;?>
2292 + <div class="ui-e-box-content">
2293 + <?php echo $inline ? '' : '<div class="ui-e-title-wrp">' . wp_kses_post($title . $subtitle) . '</div>'; ?>
2267 2294
2268 - </div>
2295 + <div class="ui-e-description">
2296 + <?php echo wp_kses_post($this->parse_text_editor($settings['description_text'])); ?>
2297 + </div>
2269 2298
2270 - <div class="ui-e-box-content">
2271 - <?php echo $inline ? '' : '<div class="ui-e-title-wrp">' . wp_kses_post($title . $subtitle) . '</div>' ;?>
2299 + <?php if ($readmore) : ?>
2300 + <a <?php $this->print_render_attribute_string('rm_link');
2301 + $this->print_render_attribute_string('rm_atts'); ?>>
2272 2302
2273 - <div class="ui-e-description">
2274 - <?php echo wp_kses_post($settings['description_text']);?>
2275 - </div>
2303 + <?php echo esc_html($rmContent); ?>
2304 + <?php if ($rmIcon) : ?>
2305 + <span>
2306 + <?php Icons_Manager::render_icon($settings['readmore_icon'], ['aria-hidden' => 'true']); ?>
2307 + </span>
2308 + <?php endif; ?>
2309 + </a>
2310 + <?php endif; ?>
2276 2311
2277 - <?php if($readmore) : ?>
2278 - <a <?php $this->print_render_attribute_string('rm_link'); $this->print_render_attribute_string('rm_atts');?>>
2279 -
2280 - <?php echo esc_html($rmContent);?>
2281 - <?php if($rmIcon) : ?>
2282 - <span>
2283 - <?php Icons_Manager::render_icon( $settings['readmore_icon'], [ 'aria-hidden' => 'true' ] ); ?>
2284 - </span>
2285 - <?php endif; ?>
2286 - </a>
2287 - <?php endif; ?>
2288 -
2289 - </div>
2290 - </div>
2291 - <?php
2292 - }
2293 -
2312 + </div>
2313 + </div>
2314 +<?php
2315 + }
2294 2316 }
2295 2317 \Elementor\Plugin::instance()->widgets_manager->register(new IconBox());