PluginProbe
Ultimate Post Kit – Elementor Post Grid, Post Carousel, Post Slider & Blog Layout Widgets / 4.0.9
Ultimate Post Kit – Elementor Post Grid, Post Carousel, Post Slider & Blog Layout Widgets v4.0.9
4.5.6 4.5.5 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 All 148 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.0.9, at modules/banner/widgets/banner.php

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