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