PluginProbe
Ultimate Post Kit – Elementor Post Grid, Post Carousel, Post Slider & Blog Layout Widgets / 4.5.3
Ultimate Post Kit – Elementor Post Grid, Post Carousel, Post Slider & Blog Layout Widgets v4.5.3
4.5.4 4.2.1 4.2.2 4.2.3 4.5.0 4.5.2 4.5.3 4.2.0 4.1.18 4.1.17 4.1.16 4.1.15 4.1.14 4.1.13 4.1.12 4.1.11 4.1.10 4.1.9 4.1.8 4.0.9 4.1.0 4.1.1 4.1.2 4.1.3 4.1.4 All 146 releases
ultimate-post-kit / modules / banner / widgets / banner.php

banner.php in Ultimate Post Kit – Elementor Post Grid, Post Carousel, Post Slider & Blog Layout Widgets 4.5.3, at modules/banner/widgets/banner.php

1,506 lines 39.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace UltimatePostKit\Modules\Banner\Widgets;
4
5 use Elementor\Controls_Manager;
6 use Elementor\Group_Control_Border;
7 use Elementor\Group_Control_Box_Shadow;
8 use Elementor\Group_Control_Typography;
9 use Elementor\Group_Control_Text_Shadow;
10 use Elementor\Group_Control_Image_Size;
11 use Elementor\Group_Control_Background;
12 use Elementor\Group_Control_Text_Stroke;
13 use UltimatePostKit\Utils;
14 use Elementor\Icons_Manager;
15
16 use UltimatePostKit\Traits\Global_Widget_Controls;
17 use UltimatePostKit\Includes\Controls\GroupQuery\Group_Control_Query;
18 use WP_Query;
19
20 if (!defined('ABSPATH')) exit; // Exit if accessed directly
21
22 class Banner extends Group_Control_Query
23 {
24
25 use Global_Widget_Controls;
26
27 private $_query = null;
28
29 public function get_name()
30 {
31 return 'upk-banner';
32 }
33
34 public function get_title()
35 {
36 return BDTUPK . esc_html__('Banner', 'ultimate-post-kit');
37 }
38
39 public function get_icon()
40 {
41 return 'upk-widget-icon upk-icon-banner upk-new';
42 }
43
44 public function get_categories()
45 {
46 return ['ultimate-post-kit'];
47 }
48
49 public function get_keywords()
50 {
51 return ['post', 'grid', 'blog', 'recent', 'news', 'banner'];
52 }
53
54 public function get_style_depends()
55 {
56 if ($this->upk_is_edit_mode()) {
57 return ['upk-all-styles'];
58 } else {
59 return ['upk-font', 'upk-banner'];
60 }
61 }
62
63 public function get_custom_help_url()
64 {
65 return 'https://youtu.be/ESZvXD-knVQ';
66 }
67
68 public function get_query()
69 {
70 return $this->_query;
71 }
72
73
74
75 public function has_widget_inner_wrapper(): bool {
76 return ! \Elementor\Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' );
77 }
78 protected function is_dynamic_content(): bool {
79 return false;
80 }
81
82 protected function register_controls() {
83 $this->start_controls_section(
84 'section_content_layout',
85 [
86 'label' => esc_html__('Layout', 'ultimate-post-kit'),
87 ]
88 );
89
90 $this->add_control(
91 'title_text',
92 [
93 'label' => __('Title', 'ultimate-post-kit'),
94 'type' => Controls_Manager::TEXT,
95 'dynamic' => [
96 'active' => true,
97 ],
98 'default' => __('Main Title', 'ultimate-post-kit'),
99 'placeholder' => __('Enter your title', 'ultimate-post-kit'),
100 'label_block' => true
101 ]
102 );
103
104 $this->add_control(
105 'sub_title_text',
106 [
107 'label' => __('Sub Title', 'ultimate-post-kit'),
108 'type' => Controls_Manager::TEXT,
109 'dynamic' => [
110 'active' => true,
111 ],
112 'default' => __('Sub Title', 'ultimate-post-kit'),
113 'placeholder' => __('Enter your sub title', 'ultimate-post-kit'),
114 'label_block' => true,
115 // 'separator' => 'before'
116 ]
117 );
118
119 $this->add_control(
120 'description_text',
121 [
122 'label' => esc_html__('Text', 'ultimate-post-kit'),
123 'type' => Controls_Manager::WYSIWYG,
124 'default' => esc_html__('It is a long established fact that a reader will be distracted by the readable', 'ultimate-post-kit'),
125 'label_block' => true,
126 'dynamic' => ['active' => true],
127 'separator' => 'before'
128 ]
129 );
130
131 $this->add_control(
132 'badge_text',
133 [
134 'label' => __('Primary Badge Text', 'ultimate-post-kit'),
135 'type' => Controls_Manager::TEXT,
136 'dynamic' => [
137 'active' => true,
138 ],
139 'default' => __('40% off', 'ultimate-post-kit'),
140 'placeholder' => __('Enter your sub title', 'ultimate-post-kit'),
141 'label_block' => true,
142 'separator' => 'before'
143 ]
144 );
145
146 $this->add_control(
147 'banner_size_text',
148 [
149 'label' => __('Secondary Badge Text', 'ultimate-post-kit'),
150 'type' => Controls_Manager::TEXT,
151 'dynamic' => [
152 'active' => true,
153 ],
154 'default' => __('banner 900px x 170px', 'ultimate-post-kit'),
155 'placeholder' => __('Enter banner size text', 'ultimate-post-kit'),
156 'label_block' => true,
157 ]
158 );
159
160 $this->add_responsive_control(
161 'image',
162 [
163 'label' => __('Image', 'ultimate-post-kit'),
164 'type' => Controls_Manager::MEDIA,
165 'dynamic' => ['active' => true],
166 'default' => [
167 'url' => Utils::get_placeholder_image_src(),
168 ],
169 'selectors' => [
170 '{{WRAPPER}} .upk-banner-wrap .upk-item' => 'background-image: url("{{URL}}");',
171 ],
172 'separator' => 'before'
173 ]
174 );
175
176 $this->add_responsive_control(
177 'position',
178 [
179 'label' => esc_html_x( 'Position', 'Background Control', 'ultimate-post-kit' ),
180 'type' => Controls_Manager::SELECT,
181 'default' => '',
182 'responsive' => true,
183 'options' => [
184 '' => esc_html_x( 'Default', 'Background Control', 'ultimate-post-kit' ),
185 'center center' => esc_html_x( 'Center Center', 'Background Control', 'ultimate-post-kit' ),
186 'center left' => esc_html_x( 'Center Left', 'Background Control', 'ultimate-post-kit' ),
187 'center right' => esc_html_x( 'Center Right', 'Background Control', 'ultimate-post-kit' ),
188 'top center' => esc_html_x( 'Top Center', 'Background Control', 'ultimate-post-kit' ),
189 'top left' => esc_html_x( 'Top Left', 'Background Control', 'ultimate-post-kit' ),
190 'top right' => esc_html_x( 'Top Right', 'Background Control', 'ultimate-post-kit' ),
191 'bottom center' => esc_html_x( 'Bottom Center', 'Background Control', 'ultimate-post-kit' ),
192 'bottom left' => esc_html_x( 'Bottom Left', 'Background Control', 'ultimate-post-kit' ),
193 'bottom right' => esc_html_x( 'Bottom Right', 'Background Control', 'ultimate-post-kit' ),
194 'initial' => esc_html_x( 'Custom', 'Background Control', 'ultimate-post-kit' ),
195
196 ],
197 'selectors' => [
198 '{{WRAPPER}} .upk-banner-wrap .upk-item' => 'background-position: {{VALUE}};',
199 ],
200 'condition' => [
201 'image[url]!' => '',
202 ],
203 ]
204 );
205
206 $this->add_responsive_control(
207 'xpos',
208 [
209 'label' => esc_html_x( 'X Position', 'Background Control', 'ultimate-post-kit' ),
210 'type' => Controls_Manager::SLIDER,
211 'responsive' => true,
212 'size_units' => [ 'px', 'em', '%', 'vw' ],
213 'default' => [
214 'unit' => 'px',
215 'size' => 0,
216 ],
217 'tablet_default' => [
218 'unit' => 'px',
219 'size' => 0,
220 ],
221 'mobile_default' => [
222 'unit' => 'px',
223 'size' => 0,
224 ],
225 'range' => [
226 'px' => [
227 'min' => -800,
228 'max' => 800,
229 ],
230 'em' => [
231 'min' => -100,
232 'max' => 100,
233 ],
234 '%' => [
235 'min' => -100,
236 'max' => 100,
237 ],
238 'vw' => [
239 'min' => -100,
240 'max' => 100,
241 ],
242 ],
243 'selectors' => [
244 '{{WRAPPER}} .upk-banner-wrap .upk-item' => 'background-position: {{SIZE}}{{UNIT}} {{ypos.SIZE}}{{ypos.UNIT}}',
245 ],
246 'condition' => [
247 'position' => [ 'initial' ],
248 'image[url]!' => '',
249 ],
250 'required' => true,
251 ]
252 );
253
254 $this->add_responsive_control(
255 'ypos',
256 [
257 'label' => esc_html_x( 'Y Position', 'Background Control', 'ultimate-post-kit' ),
258 'type' => Controls_Manager::SLIDER,
259 'responsive' => true,
260 'size_units' => [ 'px', 'em', '%', 'vh' ],
261 'default' => [
262 'unit' => 'px',
263 'size' => 0,
264 ],
265 'tablet_default' => [
266 'unit' => 'px',
267 'size' => 0,
268 ],
269 'mobile_default' => [
270 'unit' => 'px',
271 'size' => 0,
272 ],
273 'range' => [
274 'px' => [
275 'min' => -800,
276 'max' => 800,
277 ],
278 'em' => [
279 'min' => -100,
280 'max' => 100,
281 ],
282 '%' => [
283 'min' => -100,
284 'max' => 100,
285 ],
286 'vh' => [
287 'min' => -100,
288 'max' => 100,
289 ],
290 ],
291 'selectors' => [
292 '{{WRAPPER}} .upk-banner-wrap .upk-item' => 'background-position: {{xpos.SIZE}}{{xpos.UNIT}} {{SIZE}}{{UNIT}}',
293 ],
294 'condition' => [
295 'position' => [ 'initial' ],
296 'image[url]!' => '',
297 ],
298 'required' => true,
299 ]
300 );
301
302 $this->add_responsive_control(
303 'attachment',
304 [
305 'label' => esc_html_x( 'Attachment', 'Background Control', 'ultimate-post-kit' ),
306 'type' => Controls_Manager::SELECT,
307 'default' => '',
308 'options' => [
309 '' => esc_html_x( 'Default', 'Background Control', 'ultimate-post-kit' ),
310 'scroll' => esc_html_x( 'Scroll', 'Background Control', 'ultimate-post-kit' ),
311 'fixed' => esc_html_x( 'Fixed', 'Background Control', 'ultimate-post-kit' ),
312 ],
313 'selectors' => [
314 '(desktop+){{WRAPPER}} .upk-banner-wrap .upk-item' => 'background-attachment: {{VALUE}};',
315 ],
316 'condition' => [
317 'image[url]!' => '',
318 ],
319 ]
320 );
321
322 $this->add_responsive_control(
323 'attachment_alert',
324 [
325 'type' => Controls_Manager::RAW_HTML,
326 'content_classes' => 'elementor-control-field-description',
327 'raw' => esc_html__( 'Note: Attachment Fixed works only on desktop.', 'ultimate-post-kit' ),
328 'separator' => 'none',
329 'condition' => [
330 'image[url]!' => '',
331 'attachment' => 'fixed',
332 ],
333 ]
334 );
335
336 $this->add_responsive_control(
337 'repeat',
338 [
339 'label' => esc_html_x( 'Repeat', 'Background Control', 'ultimate-post-kit' ),
340 'type' => Controls_Manager::SELECT,
341 'default' => '',
342 'responsive' => true,
343 'options' => [
344 '' => esc_html_x( 'Default', 'Background Control', 'ultimate-post-kit' ),
345 'no-repeat' => esc_html_x( 'No-repeat', 'Background Control', 'ultimate-post-kit' ),
346 'repeat' => esc_html_x( 'Repeat', 'Background Control', 'ultimate-post-kit' ),
347 'repeat-x' => esc_html_x( 'Repeat-x', 'Background Control', 'ultimate-post-kit' ),
348 'repeat-y' => esc_html_x( 'Repeat-y', 'Background Control', 'ultimate-post-kit' ),
349 ],
350 'selectors' => [
351 '{{WRAPPER}} .upk-banner-wrap .upk-item' => 'background-repeat: {{VALUE}};',
352 ],
353 'condition' => [
354 'image[url]!' => '',
355 ],
356 ]
357 );
358
359 $this->add_responsive_control(
360 'size',
361 [
362 'label' => esc_html_x( 'Size', 'Background Control', 'ultimate-post-kit' ),
363 'type' => Controls_Manager::SELECT,
364 'responsive' => true,
365 'default' => '',
366 'options' => [
367 '' => esc_html_x( 'Default', 'Background Control', 'ultimate-post-kit' ),
368 'auto' => esc_html_x( 'Auto', 'Background Control', 'ultimate-post-kit' ),
369 'cover' => esc_html_x( 'Cover', 'Background Control', 'ultimate-post-kit' ),
370 'contain' => esc_html_x( 'Contain', 'Background Control', 'ultimate-post-kit' ),
371 'initial' => esc_html_x( 'Custom', 'Background Control', 'ultimate-post-kit' ),
372 ],
373 'selectors' => [
374 '{{WRAPPER}} .upk-banner-wrap .upk-item' => 'background-size: {{VALUE}};',
375 ],
376 'condition' => [
377 'image[url]!' => '',
378 ],
379 ]
380 );
381
382 $this->add_responsive_control(
383 'bg_width',
384 [
385 'label' => esc_html_x( 'Width', 'Background Control', 'ultimate-post-kit' ),
386 'type' => Controls_Manager::SLIDER,
387 'responsive' => true,
388 'size_units' => [ 'px', 'em', '%', 'vw' ],
389 'range' => [
390 'px' => [
391 'min' => 0,
392 'max' => 1000,
393 ],
394 '%' => [
395 'min' => 0,
396 'max' => 100,
397 ],
398 'vw' => [
399 'min' => 0,
400 'max' => 100,
401 ],
402 ],
403 'default' => [
404 'size' => 100,
405 'unit' => '%',
406 ],
407 'required' => true,
408 'selectors' => [
409 '{{WRAPPER}} .upk-banner-wrap .upk-item' => 'background-size: {{SIZE}}{{UNIT}} auto',
410
411 ],
412 'condition' => [
413 'size' => [ 'initial' ],
414 'image[url]!' => '',
415 ],
416 ]
417 );
418
419 $this->end_controls_section();
420
421 $this->start_controls_section(
422 'section_additional_settings',
423 [
424 'label' => esc_html__('Additional Settings', 'ultimate-post-kit'),
425 ]
426 );
427
428 $this->add_control(
429 'layout_direction',
430 [
431 'label' => __('Banner Style', 'ultimate-post-kit'),
432 'type' => Controls_Manager::SELECT,
433 'default' => 'style-1',
434 'options' => [
435 'style-1' => __('Style 1', 'ultimate-post-kit'),
436 'style-2' => __('Style 2', 'ultimate-post-kit'),
437 'style-3' => __('Style 3', 'ultimate-post-kit'),
438 ],
439 ]
440 );
441
442 $this->add_responsive_control(
443 'default_item_height',
444 [
445 'label' => esc_html__('Item Height(px)', 'ultimate-post-kit'),
446 'type' => Controls_Manager::SLIDER,
447 'range' => [
448 'px' => [
449 'min' => 200,
450 'max' => 1200,
451 ],
452 ],
453 'selectors' => [
454 '{{WRAPPER}} .upk-banner-wrap .upk-item' => 'height: {{SIZE}}{{UNIT}};',
455 ],
456
457 ]
458 );
459
460
461 $this->add_responsive_control(
462 'alignment',
463 [
464 'label' => esc_html__('Alignment', 'ultimate-post-kit'),
465 'type' => Controls_Manager::CHOOSE,
466 'options' => [
467 'left' => [
468 'title' => esc_html__('Left', 'ultimate-post-kit'),
469 'icon' => 'eicon-text-align-left',
470 ],
471 'center' => [
472 'title' => esc_html__('Center', 'ultimate-post-kit'),
473 'icon' => 'eicon-text-align-center',
474 ],
475 'right' => [
476 'title' => esc_html__('Right', 'ultimate-post-kit'),
477 'icon' => 'eicon-text-align-right',
478 ],
479 ],
480 'selectors' => [
481 '{{WRAPPER}} .upk-banner-wrap .upk-content' => 'text-align: {{VALUE}};',
482 '{{WRAPPER}} .upk-banner-style-2 .upk-buy-btn, {{WRAPPER}} .upk-banner-style-3 .upk-buy-btn' => 'justify-content: {{VALUE}}; text-align: {{VALUE}};',
483 ],
484 ]
485 );
486
487 $this->add_control(
488 'show_title',
489 [
490 'label' => __('Show Title', 'ultimate-post-kit'),
491 'type' => Controls_Manager::SWITCHER,
492 'default' => 'yes',
493 'separator' => 'before',
494 ]
495 );
496
497 $this->add_control(
498 'title_size',
499 [
500 'label' => __('Title HTML Tag', 'ultimate-post-kit'),
501 'type' => Controls_Manager::SELECT,
502 'default' => 'h3',
503 'options' => ultimate_post_kit_title_tags(),
504 'condition' => [
505 'show_title' => 'yes',
506 'title_text!' => ''
507 ],
508 ]
509 );
510
511 $this->add_control(
512 'show_sub_title',
513 [
514 'label' => __('Show Sub Title', 'ultimate-post-kit'),
515 'type' => Controls_Manager::SWITCHER,
516 'default' => 'yes',
517 'separator' => 'before',
518 ]
519 );
520
521 $this->add_control(
522 'show_text',
523 [
524 'label' => __('Show Text', 'ultimate-post-kit'),
525 'type' => Controls_Manager::SWITCHER,
526 'default' => 'yes',
527 // 'separator' => 'before',
528 ]
529 );
530
531 $this->add_control(
532 'readmore',
533 [
534 'label' => esc_html__( 'Show Read More', 'ultimate-post-kit' ),
535 'type' => Controls_Manager::SWITCHER,
536 'default' => 'yes',
537 ]
538 );
539
540
541 $this->add_control(
542 'show_badge',
543 [
544 'label' => __('Show Primary Badge', 'ultimate-post-kit'),
545 'type' => Controls_Manager::SWITCHER,
546 'default' => 'yes',
547 'separator' => 'before',
548 ]
549 );
550
551 $this->add_control(
552 'sale_badge_direction',
553 [
554 'label' => __('Primary Badge Position', 'ultimate-post-kit'),
555 'type' => Controls_Manager::SELECT,
556 'default' => 'style-1',
557 'options' => [
558 'style-1' => __('Top Left', 'ultimate-post-kit'),
559 'style-2' => __('Top Right', 'ultimate-post-kit'),
560 'style-3' => __('Bottom Left', 'ultimate-post-kit'),
561 'style-4' => __('Bottom Right', 'ultimate-post-kit'),
562 'style-5' => __('Bottom Center', 'ultimate-post-kit'),
563 'style-6' => __('Top Center', 'ultimate-post-kit'),
564 'style-7' => __('Vertical Left', 'ultimate-post-kit'),
565 'style-8' => __('Vertical Right', 'ultimate-post-kit'),
566 ],
567 'condition' => [
568 'show_badge' => 'yes'
569 ]
570 ]
571 );
572
573
574 $this->add_control(
575 'show_banner_size',
576 [
577 'label' => __('Show Secondary Badge', 'ultimate-post-kit'),
578 'type' => Controls_Manager::SWITCHER,
579 'default' => 'yes',
580 'separator' => 'before',
581 ]
582 );
583
584
585
586 $this->add_control(
587 'size_badge_direction',
588 [
589 'label' => __('Secondary Badge Position', 'ultimate-post-kit'),
590 'type' => Controls_Manager::SELECT,
591 'default' => 'style-4',
592 'options' => [
593 'style-1' => __('Top Left', 'ultimate-post-kit'),
594 'style-2' => __('Top Right', 'ultimate-post-kit'),
595 'style-3' => __('Bottom Left', 'ultimate-post-kit'),
596 'style-4' => __('Bottom Right', 'ultimate-post-kit'),
597 'style-5' => __('Bottom Center', 'ultimate-post-kit'),
598 'style-6' => __('Top Center', 'ultimate-post-kit'),
599 'style-7' => __('Vertical Left', 'ultimate-post-kit'),
600 'style-8' => __('Vertical Right', 'ultimate-post-kit'),
601 ],
602 'condition' => [
603 'show_banner_size' => 'yes'
604 ]
605 ]
606 );
607
608 $this->end_controls_section();
609
610 $this->start_controls_section(
611 'section_content_readmore',
612 [
613 'label' => esc_html__( 'Read More', 'ultimate-post-kit' ),
614 'condition' => [
615 'readmore' => 'yes',
616 ],
617 ]
618 );
619
620 $this->add_control(
621 'readmore_text',
622 [
623 'label' => esc_html__( 'Read More Text', 'ultimate-post-kit' ),
624 'type' => Controls_Manager::TEXT,
625 'dynamic' => [ 'active' => true ],
626 'default' => esc_html__( 'Read More', 'ultimate-post-kit' ),
627 'placeholder' => esc_html__( 'Read More', 'ultimate-post-kit' ),
628 ]
629 );
630
631 $this->add_control(
632 'readmore_link',
633 [
634 'label' => esc_html__( 'Link', 'ultimate-post-kit' ),
635 'type' => Controls_Manager::URL,
636 'dynamic' => [ 'active' => true ],
637 'placeholder' => 'http://your-link.com',
638 'default' => [
639 'url' => '#',
640 ],
641 'label_block' => false,
642 ]
643 );
644
645 $this->add_control(
646 'readmore_icon',
647 [
648 'label' => esc_html__( 'Icon', 'ultimate-post-kit' ),
649 'type' => Controls_Manager::ICONS,
650 'label_block' => false,
651 'skin' => 'inline'
652 ]
653 );
654
655 $this->add_control(
656 'icon_align',
657 [
658 'label' => esc_html__( 'Icon Position', 'ultimate-post-kit' ),
659 'type' => Controls_Manager::CHOOSE,
660 'default' => 'right',
661 'toggle' => false,
662 'options' => [
663 'left' => [
664 'title' => __( 'Left', 'ultimate-post-kit' ),
665 'icon' => 'eicon-h-align-left',
666 ],
667 'right' => [
668 'title' => __( 'Right', 'ultimate-post-kit' ),
669 'icon' => 'eicon-h-align-right',
670 ],
671 ],
672 'condition' => [
673 'readmore_icon[value]!' => '',
674 ],
675 ]
676 );
677
678 $this->add_responsive_control(
679 'icon_indent',
680 [
681 'label' => esc_html__( 'Icon Spacing', 'ultimate-post-kit' ),
682 'type' => Controls_Manager::SLIDER,
683 'default' => [
684 'size' => 8,
685 ],
686 'range' => [
687 'px' => [
688 'max' => 50,
689 ],
690 ],
691 'condition' => [
692 'readmore_icon[value]!' => '',
693 ],
694 'selectors' => [
695 '{{WRAPPER}} .upk-banner-readmore .upk-button-icon-align-right' => is_rtl() ? 'margin-right: {{SIZE}}{{UNIT}};' : 'margin-left: {{SIZE}}{{UNIT}};',
696 '{{WRAPPER}} .upk-banner-readmore .upk-button-icon-align-left' => is_rtl() ? 'margin-left: {{SIZE}}{{UNIT}};' : 'margin-right: {{SIZE}}{{UNIT}};',
697 ],
698 ]
699 );
700
701 $this->end_controls_section();
702
703 //Style
704 $this->start_controls_section(
705 'upk_section_style',
706 [
707 'label' => esc_html__('Items', 'ultimate-post-kit'),
708 'tab' => Controls_Manager::TAB_STYLE,
709 ]
710 );
711
712 $this->add_control(
713 'overlay_type',
714 [
715 'label' => esc_html__('Overlay', 'ultimate-post-kit'),
716 'type' => Controls_Manager::SELECT,
717 'default' => 'none',
718 'options' => [
719 'none' => esc_html__('None', 'ultimate-post-kit'),
720 'background' => esc_html__('Background', 'ultimate-post-kit'),
721 'blend' => esc_html__('Blend', 'ultimate-post-kit'),
722 ],
723 ]
724 );
725
726 $this->add_group_control(
727 Group_Control_Background::get_type(),
728 [
729 'name' => 'overlay_color',
730 'label' => esc_html__('Background', 'ultimate-post-kit'),
731 'types' => ['classic', 'gradient'],
732 // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude -- Elementor widget query built from user-configured controls; expected behaviour.
733 'exclude' => ['image'],
734 'selector' => '{{WRAPPER}} .upk-banner-wrap .upk-item::before',
735 'fields_options' => [
736 'background' => [
737 'default' => 'classic',
738 ],
739 'color' => [
740 'default' => 'rgba(0, 0, 0, 0.609)',
741 ],
742 ],
743 'condition' => [
744 'overlay_type' => ['background', 'blend'],
745 ],
746 ]
747 );
748
749 $this->add_control(
750 'blend_type',
751 [
752 'label' => esc_html__('Blend Type', 'ultimate-post-kit'),
753 'type' => Controls_Manager::SELECT,
754 'default' => 'multiply',
755 'options' => ultimate_post_kit_blend_options(),
756 'condition' => [
757 'overlay_type' => 'blend',
758 ],
759 'selectors' => [
760 '{{WRAPPER}} .upk-banner-wrap .upk-item::before' => 'mix-blend-mode: {{VALUE}};'
761 ],
762 ]
763 );
764
765 $this->add_group_control(
766 Group_Control_Border::get_type(),
767 [
768 'name' => 'border',
769 'selector' => '{{WRAPPER}} .upk-banner-wrap .upk-item',
770 'separator' => 'before'
771 ]
772 );
773
774 $this->add_responsive_control(
775 'item_border_radius',
776 [
777 'label' => esc_html__('Border Radius', 'ultimate-post-kit'),
778 'type' => Controls_Manager::DIMENSIONS,
779 'size_units' => ['px', '%'],
780 'selectors' => [
781 '{{WRAPPER}} .upk-banner-wrap .upk-item' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
782 ],
783 ]
784 );
785
786 $this->add_responsive_control(
787 'content_padding',
788 [
789 'label' => esc_html__('Padding', 'ultimate-post-kit'),
790 'type' => Controls_Manager::DIMENSIONS,
791 'size_units' => ['px', 'em', '%'],
792 'selectors' => [
793 '{{WRAPPER}} .upk-banner-wrap .upk-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
794 ],
795 ]
796 );
797
798 $this->add_group_control(
799 Group_Control_Box_Shadow::get_type(),
800 [
801 'name' => 'item_shadow',
802 'selector' => '{{WRAPPER}} .upk-banner-wrap .upk-item',
803 ]
804 );
805
806 $this->end_controls_section();
807
808 $this->start_controls_section(
809 'section_style_title',
810 [
811 'label' => esc_html__('Title', 'ultimate-post-kit'),
812 'tab' => Controls_Manager::TAB_STYLE,
813 'condition' => [
814 'show_title' => 'yes',
815 'title_text!' => ''
816 ],
817 ]
818 );
819
820 $this->add_control(
821 'title_color',
822 [
823 'label' => esc_html__('Color', 'ultimate-post-kit'),
824 'type' => Controls_Manager::COLOR,
825 'selectors' => [
826 '{{WRAPPER}} .upk-banner-wrap .upk-title' => 'color: {{VALUE}};',
827 ],
828 ]
829 );
830
831 $this->add_responsive_control(
832 'title_margin',
833 [
834 'label' => esc_html__('Margin', 'ultimate-post-kit'),
835 'type' => Controls_Manager::DIMENSIONS,
836 'size_units' => ['px', 'em', '%'],
837 'selectors' => [
838 '{{WRAPPER}} .upk-banner-wrap .upk-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
839 ],
840 ]
841 );
842
843 $this->add_group_control(
844 Group_Control_Typography::get_type(),
845 [
846 'name' => 'title_typography',
847 'label' => esc_html__('Typography', 'ultimate-post-kit'),
848 'selector' => '{{WRAPPER}} .upk-banner-wrap .upk-title',
849 ]
850 );
851
852 $this->add_group_control(
853 Group_Control_Text_Shadow::get_type(),
854 [
855 'name' => 'title_text_shadow',
856 'label' => __('Text Shadow', 'ultimate-post-kit'),
857 'selector' => '{{WRAPPER}} .upk-banner-wrap .upk-title',
858 ]
859 );
860
861 $this->add_group_control(
862 Group_Control_Text_Stroke::get_type(),
863 [
864 'name' => 'title_text_stroke',
865 'label' => __('Text Stroke', 'ultimate-post-kit'),
866 'selector' => '{{WRAPPER}} .upk-banner-wrap .upk-title',
867 ]
868 );
869
870 $this->end_controls_section();
871
872
873 $this->start_controls_section(
874 'section_style_sub_title',
875 [
876 'label' => esc_html__('Sub Title', 'ultimate-post-kit'),
877 'tab' => Controls_Manager::TAB_STYLE,
878 'condition' => [
879 'show_sub_title' => 'yes',
880 'sub_title_text!' => ''
881 ],
882 ]
883 );
884
885 $this->add_control(
886 'sub_title_color',
887 [
888 'label' => esc_html__('Color', 'ultimate-post-kit'),
889 'type' => Controls_Manager::COLOR,
890 'selectors' => [
891 '{{WRAPPER}} .upk-banner-wrap .upk-sub-title' => 'color: {{VALUE}};',
892 ],
893 ]
894 );
895
896 $this->add_responsive_control(
897 'sub_title_padding',
898 [
899 'label' => esc_html__('Padding', 'ultimate-post-kit'),
900 'type' => Controls_Manager::DIMENSIONS,
901 'size_units' => ['px', 'em', '%'],
902 'selectors' => [
903 '{{WRAPPER}} .upk-banner-wrap .upk-sub-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
904 ],
905 ]
906 );
907
908 $this->add_responsive_control(
909 'sub_title_margin',
910 [
911 'label' => esc_html__('Margin', 'ultimate-post-kit'),
912 'type' => Controls_Manager::DIMENSIONS,
913 'size_units' => ['px', 'em', '%'],
914 'selectors' => [
915 '{{WRAPPER}} .upk-banner-wrap .upk-sub-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
916 ],
917 ]
918 );
919
920
921 $this->add_group_control(
922 Group_Control_Typography::get_type(),
923 [
924 'name' => 'sub_title_typography',
925 'label' => esc_html__('Typography', 'ultimate-post-kit'),
926 'selector' => '{{WRAPPER}} .upk-banner-wrap .upk-sub-title',
927 ]
928 );
929
930 $this->add_group_control(
931 Group_Control_Text_Shadow::get_type(),
932 [
933 'name' => 'sub_title_text_shadow',
934 'label' => __('Text Shadow', 'ultimate-post-kit'),
935 'selector' => '{{WRAPPER}} .upk-banner-wrap .upk-sub-title',
936 ]
937 );
938
939 $this->end_controls_section();
940
941 $this->start_controls_section(
942 'section_style_text',
943 [
944 'label' => esc_html__('Text', 'ultimate-post-kit'),
945 'tab' => Controls_Manager::TAB_STYLE,
946 'condition' => [
947 'show_text' => 'yes',
948 'layout_direction!' => 'style-4',
949 'description_text!' => ''
950 ],
951 ]
952 );
953
954 $this->add_control(
955 'text_color',
956 [
957 'label' => esc_html__('Color', 'ultimate-post-kit'),
958 'type' => Controls_Manager::COLOR,
959 'selectors' => [
960 '{{WRAPPER}} .upk-banner-wrap .upk-text' => 'color: {{VALUE}};',
961 ],
962 ]
963 );
964
965 $this->add_responsive_control(
966 'text_spacing',
967 [
968 'label' => esc_html__('Margin', 'ultimate-post-kit'),
969 'type' => Controls_Manager::DIMENSIONS,
970 'size_units' => ['px', 'em', '%'],
971 'selectors' => [
972 '{{WRAPPER}} .upk-banner-wrap .upk-text' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
973 ],
974 ]
975 );
976
977 $this->add_group_control(
978 Group_Control_Typography::get_type(),
979 [
980 'name' => 'text_typography',
981 'label' => esc_html__('Typography', 'ultimate-post-kit'),
982 'selector' => '{{WRAPPER}} .upk-banner-wrap .upk-text',
983 ]
984 );
985
986 $this->end_controls_section();
987
988 $this->start_controls_section(
989 'section_style_link_btn',
990 [
991 'label' => esc_html__('Read More', 'ultimate-post-kit'),
992 'tab' => Controls_Manager::TAB_STYLE,
993 'condition' => [
994 'readmore' => 'yes',
995 'readmore_text!' => ''
996 ]
997 ]
998 );
999
1000
1001 $this->start_controls_tabs('tabs_link_btn_style');
1002
1003 $this->start_controls_tab(
1004 'tab_link_btn_normal',
1005 [
1006 'label' => esc_html__('Normal', 'ultimate-post-kit'),
1007 ]
1008 );
1009
1010 $this->add_control(
1011 'link_btn_color',
1012 [
1013 'label' => esc_html__('Color', 'ultimate-post-kit'),
1014 'type' => Controls_Manager::COLOR,
1015 'selectors' => [
1016 '{{WRAPPER}} .upk-banner-wrap .upk-buy-btn a' => 'color: {{VALUE}};',
1017 '{{WRAPPER}} .upk-banner-wrap .upk-buy-btn a svg' => 'fill: {{VALUE}};',
1018 ],
1019 ]
1020 );
1021
1022 $this->add_group_control(
1023 Group_Control_Background::get_type(),
1024 [
1025 'name' => 'link_btn_background',
1026 'selector' => '{{WRAPPER}} .upk-banner-wrap .upk-buy-btn a',
1027 ]
1028 );
1029
1030 $this->add_group_control(
1031 Group_Control_Border::get_type(),
1032 [
1033 'name' => 'link_btn_border',
1034 'selector' => '{{WRAPPER}} .upk-banner-wrap .upk-buy-btn a',
1035 ]
1036 );
1037
1038 $this->add_responsive_control(
1039 'link_btn_border_radius',
1040 [
1041 'label' => esc_html__('Border Radius', 'ultimate-post-kit'),
1042 'type' => Controls_Manager::DIMENSIONS,
1043 'size_units' => ['px', '%'],
1044 'selectors' => [
1045 '{{WRAPPER}} .upk-banner-wrap .upk-buy-btn a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1046 ],
1047 ]
1048 );
1049
1050 $this->add_responsive_control(
1051 'link_btn_padding',
1052 [
1053 'label' => esc_html__('Padding', 'ultimate-post-kit'),
1054 'type' => Controls_Manager::DIMENSIONS,
1055 'size_units' => ['px', 'em', '%'],
1056 'selectors' => [
1057 '{{WRAPPER}} .upk-banner-wrap .upk-buy-btn a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1058 ],
1059 ]
1060 );
1061
1062 $this->add_responsive_control(
1063 'link_btn_margin',
1064 [
1065 'label' => esc_html__('Margin', 'ultimate-post-kit'),
1066 'type' => Controls_Manager::DIMENSIONS,
1067 'size_units' => ['px', 'em', '%'],
1068 'selectors' => [
1069 '{{WRAPPER}} .upk-banner-wrap .upk-buy-btn' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1070 ],
1071 ]
1072 );
1073
1074 $this->add_group_control(
1075 Group_Control_Box_Shadow::get_type(),
1076 [
1077 'name' => 'link_btn_shadow',
1078 'selector' => '{{WRAPPER}} .upk-banner-wrap .upk-buy-btn a',
1079 ]
1080 );
1081
1082 $this->add_group_control(
1083 Group_Control_Typography::get_type(),
1084 [
1085 'name' => 'link_btn_typography',
1086 'label' => esc_html__('Typography', 'ultimate-post-kit'),
1087 'selector' => '{{WRAPPER}} .upk-banner-wrap .upk-buy-btn a',
1088 ]
1089 );
1090
1091 $this->end_controls_tab();
1092
1093 $this->start_controls_tab(
1094 'tab_link_btn_hover',
1095 [
1096 'label' => esc_html__('Hover', 'ultimate-post-kit'),
1097 ]
1098 );
1099
1100 $this->add_control(
1101 'link_btn_hover_color',
1102 [
1103 'label' => esc_html__('Color', 'ultimate-post-kit'),
1104 'type' => Controls_Manager::COLOR,
1105 'selectors' => [
1106 '{{WRAPPER}} .upk-banner-wrap .upk-buy-btn a:hover' => 'color: {{VALUE}};',
1107 '{{WRAPPER}} .upk-banner-wrap .upk-buy-btn a:hover svg' => 'fill: {{VALUE}};',
1108 ],
1109 ]
1110 );
1111
1112 $this->add_group_control(
1113 Group_Control_Background::get_type(),
1114 [
1115 'name' => 'link_btn_hover_background',
1116 'selector' => '{{WRAPPER}} .upk-banner-wrap .upk-buy-btn a:hover',
1117 ]
1118 );
1119
1120 $this->add_control(
1121 'link_btn_hover_border_color',
1122 [
1123 'label' => esc_html__('Border Color', 'ultimate-post-kit'),
1124 'type' => Controls_Manager::COLOR,
1125 'condition' => [
1126 'link_btn_border_border!' => '',
1127 ],
1128 'selectors' => [
1129 '{{WRAPPER}} .upk-banner-wrap .upk-buy-btn a:hover' => 'border-color: {{VALUE}};',
1130 ],
1131 ]
1132 );
1133
1134 $this->add_control(
1135 'readmore_hover_animation',
1136 [
1137 'label' => esc_html__( 'Animation', 'ultimate-post-kit' ),
1138 'type' => Controls_Manager::HOVER_ANIMATION,
1139 ]
1140 );
1141
1142 $this->end_controls_tab();
1143
1144 $this->end_controls_tabs();
1145
1146 $this->end_controls_section();
1147
1148
1149 $this->start_controls_section(
1150 'section_style_badge',
1151 [
1152 'label' => esc_html__('Badge', 'ultimate-post-kit'),
1153 'tab' => Controls_Manager::TAB_STYLE,
1154 'conditions' => [
1155 'relation' => 'or',
1156 'terms' => [
1157 [
1158 'name' => 'show_badge',
1159 'value' => 'yes'
1160 ],
1161 [
1162 'name' => 'show_banner_size',
1163 'value' => 'yes'
1164 ],
1165 ]
1166 ],
1167 ]
1168 );
1169
1170
1171 $this->start_controls_tabs('tabs_badge_style');
1172
1173 $this->start_controls_tab(
1174 'tab_badge_normal',
1175 [
1176 'label' => esc_html__('Primary', 'ultimate-post-kit'),
1177 'condition' => [
1178 'show_badge' => 'yes',
1179 ],
1180 ]
1181 );
1182
1183 $this->add_control(
1184 'badge_color',
1185 [
1186 'label' => esc_html__('Color', 'ultimate-post-kit'),
1187 'type' => Controls_Manager::COLOR,
1188 'selectors' => [
1189 '{{WRAPPER}} .upk-banner-wrap .upk-discount' => 'color: {{VALUE}};',
1190 ],
1191 'condition' => [
1192 'show_badge' => 'yes',
1193 ],
1194 ]
1195 );
1196
1197 $this->add_group_control(
1198 Group_Control_Background::get_type(),
1199 [
1200 'name' => 'badge_background',
1201 'selector' => '{{WRAPPER}} .upk-banner-wrap .upk-discount',
1202 'condition' => [
1203 'show_badge' => 'yes',
1204 ],
1205 ]
1206 );
1207
1208 $this->add_group_control(
1209 Group_Control_Border::get_type(),
1210 [
1211 'name' => 'badge_border',
1212 'selector' => '{{WRAPPER}} .upk-banner-wrap .upk-discount',
1213 'condition' => [
1214 'show_badge' => 'yes',
1215 ],
1216 ]
1217 );
1218
1219 $this->add_responsive_control(
1220 'badge_border_radius',
1221 [
1222 'label' => esc_html__('Border Radius', 'ultimate-post-kit'),
1223 'type' => Controls_Manager::DIMENSIONS,
1224 'size_units' => ['px', '%'],
1225 'selectors' => [
1226 '{{WRAPPER}} .upk-banner-wrap .upk-discount' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1227 ],
1228 'condition' => [
1229 'show_badge' => 'yes',
1230 ],
1231 ]
1232 );
1233
1234 $this->add_responsive_control(
1235 'badge_padding',
1236 [
1237 'label' => esc_html__('Padding', 'ultimate-post-kit'),
1238 'type' => Controls_Manager::DIMENSIONS,
1239 'size_units' => ['px', 'em', '%'],
1240 'selectors' => [
1241 '{{WRAPPER}} .upk-banner-wrap .upk-discount' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1242 ],
1243 'condition' => [
1244 'show_badge' => 'yes',
1245 ],
1246 ]
1247 );
1248
1249 $this->add_responsive_control(
1250 'badge_margin',
1251 [
1252 'label' => esc_html__('Margin', 'ultimate-post-kit'),
1253 'type' => Controls_Manager::DIMENSIONS,
1254 'size_units' => ['px', 'em', '%'],
1255 'selectors' => [
1256 '{{WRAPPER}} .upk-banner-wrap .upk-discount' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1257 ],
1258 'condition' => [
1259 'show_badge' => 'yes',
1260 ],
1261 ]
1262 );
1263
1264 $this->add_group_control(
1265 Group_Control_Box_Shadow::get_type(),
1266 [
1267 'name' => 'badge_shadow',
1268 'selector' => '{{WRAPPER}} .upk-banner-wrap .upk-discount',
1269 'condition' => [
1270 'show_badge' => 'yes',
1271 ],
1272 ]
1273 );
1274
1275 $this->add_group_control(
1276 Group_Control_Typography::get_type(),
1277 [
1278 'name' => 'badge_typography',
1279 'label' => esc_html__('Typography', 'ultimate-post-kit'),
1280 'selector' => '{{WRAPPER}} .upk-banner-wrap .upk-discount',
1281 'condition' => [
1282 'show_badge' => 'yes',
1283 ],
1284 ]
1285 );
1286
1287 $this->end_controls_tab();
1288
1289 $this->start_controls_tab(
1290 'tab_badge_banner_size',
1291 [
1292 'label' => esc_html__('Secondary', 'ultimate-post-kit'),
1293 'condition' => [
1294 'show_banner_size' => 'yes',
1295 ],
1296 ]
1297 );
1298
1299 $this->add_control(
1300 'banner_size_color',
1301 [
1302 'label' => esc_html__('Color', 'ultimate-post-kit'),
1303 'type' => Controls_Manager::COLOR,
1304 'selectors' => [
1305 '{{WRAPPER}} .upk-banner-wrap .upk-banner-size-text' => 'color: {{VALUE}};',
1306 ],
1307 'condition' => [
1308 'show_banner_size' => 'yes',
1309 ],
1310 ]
1311 );
1312
1313 $this->add_group_control(
1314 Group_Control_Background::get_type(),
1315 [
1316 'name' => 'banner_size_background',
1317 'selector' => '{{WRAPPER}} .upk-banner-wrap .upk-banner-size-text',
1318 'condition' => [
1319 'show_banner_size' => 'yes',
1320 ],
1321 ]
1322 );
1323
1324 $this->add_group_control(
1325 Group_Control_Border::get_type(),
1326 [
1327 'name' => 'banner_size_border',
1328 'selector' => '{{WRAPPER}} .upk-banner-wrap .upk-banner-size-text',
1329 'condition' => [
1330 'show_banner_size' => 'yes',
1331 ],
1332 ]
1333 );
1334
1335 $this->add_responsive_control(
1336 'banner_size_border_radius',
1337 [
1338 'label' => esc_html__('Border Radius', 'ultimate-post-kit'),
1339 'type' => Controls_Manager::DIMENSIONS,
1340 'size_units' => ['px', '%'],
1341 'selectors' => [
1342 '{{WRAPPER}} .upk-banner-wrap .upk-banner-size-text' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1343 ],
1344 'condition' => [
1345 'show_banner_size' => 'yes',
1346 ],
1347 ]
1348 );
1349
1350 $this->add_responsive_control(
1351 'banner_size_padding',
1352 [
1353 'label' => esc_html__('Padding', 'ultimate-post-kit'),
1354 'type' => Controls_Manager::DIMENSIONS,
1355 'size_units' => ['px', 'em', '%'],
1356 'selectors' => [
1357 '{{WRAPPER}} .upk-banner-wrap .upk-banner-size-text' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1358 ],
1359 'condition' => [
1360 'show_banner_size' => 'yes',
1361 ],
1362 ]
1363 );
1364
1365 $this->add_responsive_control(
1366 'banner_size_margin',
1367 [
1368 'label' => esc_html__('Margin', 'ultimate-post-kit'),
1369 'type' => Controls_Manager::DIMENSIONS,
1370 'size_units' => ['px', 'em', '%'],
1371 'selectors' => [
1372 '{{WRAPPER}} .upk-banner-wrap .upk-banner-size-text' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1373 ],
1374 'condition' => [
1375 'show_banner_size' => 'yes',
1376 ],
1377 ]
1378 );
1379
1380 $this->add_group_control(
1381 Group_Control_Box_Shadow::get_type(),
1382 [
1383 'name' => 'banner_size_shadow',
1384 'selector' => '{{WRAPPER}} .upk-banner-wrap .upk-banner-size-text',
1385 'condition' => [
1386 'show_banner_size' => 'yes',
1387 ],
1388 ]
1389 );
1390
1391 $this->add_group_control(
1392 Group_Control_Typography::get_type(),
1393 [
1394 'name' => 'banner_size_typography',
1395 'label' => esc_html__('Typography', 'ultimate-post-kit'),
1396 'selector' => '{{WRAPPER}} .upk-banner-wrap .upk-banner-size-text',
1397 'condition' => [
1398 'show_banner_size' => 'yes',
1399 ],
1400 ]
1401 );
1402
1403 $this->end_controls_tab();
1404
1405 $this->end_controls_tabs();
1406
1407 $this->end_controls_section();
1408 }
1409
1410
1411 public function render_readmore() {
1412 $settings = $this->get_settings_for_display();
1413
1414 if ( ! $settings['readmore'] ) {
1415 return;
1416 }
1417
1418 $this->add_render_attribute(
1419 [
1420 'readmore-link' => [
1421 'class' => [
1422 'upk-banner-readmore',
1423 $settings['readmore_hover_animation'] ? 'elementor-animation-' . $settings['readmore_hover_animation'] : '',
1424 ],
1425 'href' => isset($settings['readmore_link']['url']) ? esc_url($settings['readmore_link']['url']) : '#',
1426 'target' => $settings['readmore_link']['is_external'] ? '_blank' : '_self'
1427 ]
1428 ], '', '', true
1429 );
1430
1431 ?>
1432 <?php if (( ! empty( $settings['readmore_link']['url'] )) && ( $settings['readmore'] )): ?>
1433 <div class="upk-buy-btn">
1434 <a <?php $this->print_render_attribute_string( 'readmore-link' ); ?>>
1435 <?php echo esc_html($settings['readmore_text']); ?>
1436 <?php if ($settings['readmore_icon']['value']) : ?>
1437 <span class="upk-button-icon-align-<?php echo esc_attr($settings['icon_align']); ?>">
1438 <?php Icons_Manager::render_icon( $settings['readmore_icon'], [ 'aria-hidden' => 'true', 'class' => 'fa-fw' ] ); ?>
1439 </span>
1440 <?php endif; ?>
1441 </a>
1442 </div>
1443 <?php endif;
1444 }
1445
1446 public function render_banner_content() {
1447 $settings = $this->get_settings_for_display();
1448
1449 ?>
1450
1451 <div class="upk-content">
1452 <div class="upk-content-inner">
1453 <?php if ($settings['show_title'] and $settings['title_text']) : ?>
1454 <<?php echo esc_attr(Utils::get_valid_html_tag($settings['title_size'])); ?> class="upk-title">
1455 <?php echo wp_kses_post($settings['title_text'], ultimate_post_kit_title_tags('title_text')); ?>
1456 </<?php echo esc_attr(Utils::get_valid_html_tag($settings['title_size'])); ?>>
1457 <?php endif; ?>
1458
1459 <?php if ($settings['sub_title_text'] and 'yes' == $settings['show_sub_title']) : ?>
1460 <div class="upk-sub-title">
1461 <?php echo esc_html($settings['sub_title_text']); ?>
1462 </div>
1463 <?php endif; ?>
1464 </div>
1465
1466 <?php if ($settings['description_text'] and 'yes' == $settings['show_text'] and $settings['layout_direction'] !== 'style-4') : ?>
1467 <div class="upk-text">
1468 <?php echo wp_kses_post($settings['description_text'], ultimate_post_kit_title_tags('description_text')); ?>
1469 </div>
1470 <?php endif; ?>
1471
1472 <?php $this->render_readmore(); ?>
1473 </div>
1474
1475 <?php if ('yes' == $settings['show_badge'] and $settings['badge_text']) : ?>
1476 <div class="upk-discount">
1477 <?php echo esc_html($settings['badge_text']); ?>
1478 </div>
1479 <?php endif; ?>
1480
1481 <?php if ('yes' == $settings['show_banner_size'] and $settings['banner_size_text']) : ?>
1482 <div class="upk-banner-size-text">
1483 <span>
1484 <?php echo esc_html($settings['banner_size_text']); ?>
1485 </span>
1486 </div>
1487 <?php endif; ?>
1488
1489 <?php
1490 }
1491
1492 protected function render() {
1493 $settings = $this->get_settings_for_display();
1494
1495 $this->add_render_attribute('upk-banner', 'class', ['upk-banner-wrap ', 'upk-sale-badge-' . $settings['sale_badge_direction'], 'upk-size-badge-' . $settings['size_badge_direction'], 'upk-banner-' . $settings['layout_direction'] . '']);
1496
1497 ?>
1498 <div <?php $this->print_render_attribute_string('upk-banner'); ?>>
1499 <div class="upk-item">
1500 <?php $this->render_banner_content(); ?>
1501 </div>
1502 </div>
1503 <?php
1504 }
1505 }
1506