PluginProbe
Ultimate Post Kit – Elementor Post Grid, Post Carousel, Post Slider & Blog Layout Widgets / 4.1.16
Ultimate Post Kit – Elementor Post Grid, Post Carousel, Post Slider & Blog Layout Widgets v4.1.16
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.1.16, at modules/banner/widgets/banner.php

1,505 lines 39.5 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 'exclude' => ['image'],
733 'selector' => '{{WRAPPER}} .upk-banner-wrap .upk-item::before',
734 'fields_options' => [
735 'background' => [
736 'default' => 'classic',
737 ],
738 'color' => [
739 'default' => 'rgba(0, 0, 0, 0.609)',
740 ],
741 ],
742 'condition' => [
743 'overlay_type' => ['background', 'blend'],
744 ],
745 ]
746 );
747
748 $this->add_control(
749 'blend_type',
750 [
751 'label' => esc_html__('Blend Type', 'ultimate-post-kit'),
752 'type' => Controls_Manager::SELECT,
753 'default' => 'multiply',
754 'options' => ultimate_post_kit_blend_options(),
755 'condition' => [
756 'overlay_type' => 'blend',
757 ],
758 'selectors' => [
759 '{{WRAPPER}} .upk-banner-wrap .upk-item::before' => 'mix-blend-mode: {{VALUE}};'
760 ],
761 ]
762 );
763
764 $this->add_group_control(
765 Group_Control_Border::get_type(),
766 [
767 'name' => 'border',
768 'selector' => '{{WRAPPER}} .upk-banner-wrap .upk-item',
769 'separator' => 'before'
770 ]
771 );
772
773 $this->add_responsive_control(
774 'item_border_radius',
775 [
776 'label' => esc_html__('Border Radius', 'ultimate-post-kit'),
777 'type' => Controls_Manager::DIMENSIONS,
778 'size_units' => ['px', '%'],
779 'selectors' => [
780 '{{WRAPPER}} .upk-banner-wrap .upk-item' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
781 ],
782 ]
783 );
784
785 $this->add_responsive_control(
786 'content_padding',
787 [
788 'label' => esc_html__('Padding', 'ultimate-post-kit'),
789 'type' => Controls_Manager::DIMENSIONS,
790 'size_units' => ['px', 'em', '%'],
791 'selectors' => [
792 '{{WRAPPER}} .upk-banner-wrap .upk-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
793 ],
794 ]
795 );
796
797 $this->add_group_control(
798 Group_Control_Box_Shadow::get_type(),
799 [
800 'name' => 'item_shadow',
801 'selector' => '{{WRAPPER}} .upk-banner-wrap .upk-item',
802 ]
803 );
804
805 $this->end_controls_section();
806
807 $this->start_controls_section(
808 'section_style_title',
809 [
810 'label' => esc_html__('Title', 'ultimate-post-kit'),
811 'tab' => Controls_Manager::TAB_STYLE,
812 'condition' => [
813 'show_title' => 'yes',
814 'title_text!' => ''
815 ],
816 ]
817 );
818
819 $this->add_control(
820 'title_color',
821 [
822 'label' => esc_html__('Color', 'ultimate-post-kit'),
823 'type' => Controls_Manager::COLOR,
824 'selectors' => [
825 '{{WRAPPER}} .upk-banner-wrap .upk-title' => 'color: {{VALUE}};',
826 ],
827 ]
828 );
829
830 $this->add_responsive_control(
831 'title_margin',
832 [
833 'label' => esc_html__('Margin', 'ultimate-post-kit'),
834 'type' => Controls_Manager::DIMENSIONS,
835 'size_units' => ['px', 'em', '%'],
836 'selectors' => [
837 '{{WRAPPER}} .upk-banner-wrap .upk-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
838 ],
839 ]
840 );
841
842 $this->add_group_control(
843 Group_Control_Typography::get_type(),
844 [
845 'name' => 'title_typography',
846 'label' => esc_html__('Typography', 'ultimate-post-kit'),
847 'selector' => '{{WRAPPER}} .upk-banner-wrap .upk-title',
848 ]
849 );
850
851 $this->add_group_control(
852 Group_Control_Text_Shadow::get_type(),
853 [
854 'name' => 'title_text_shadow',
855 'label' => __('Text Shadow', 'ultimate-post-kit'),
856 'selector' => '{{WRAPPER}} .upk-banner-wrap .upk-title',
857 ]
858 );
859
860 $this->add_group_control(
861 Group_Control_Text_Stroke::get_type(),
862 [
863 'name' => 'title_text_stroke',
864 'label' => __('Text Stroke', 'ultimate-post-kit'),
865 'selector' => '{{WRAPPER}} .upk-banner-wrap .upk-title',
866 ]
867 );
868
869 $this->end_controls_section();
870
871
872 $this->start_controls_section(
873 'section_style_sub_title',
874 [
875 'label' => esc_html__('Sub Title', 'ultimate-post-kit'),
876 'tab' => Controls_Manager::TAB_STYLE,
877 'condition' => [
878 'show_sub_title' => 'yes',
879 'sub_title_text!' => ''
880 ],
881 ]
882 );
883
884 $this->add_control(
885 'sub_title_color',
886 [
887 'label' => esc_html__('Color', 'ultimate-post-kit'),
888 'type' => Controls_Manager::COLOR,
889 'selectors' => [
890 '{{WRAPPER}} .upk-banner-wrap .upk-sub-title' => 'color: {{VALUE}};',
891 ],
892 ]
893 );
894
895 $this->add_responsive_control(
896 'sub_title_padding',
897 [
898 'label' => esc_html__('Padding', 'ultimate-post-kit'),
899 'type' => Controls_Manager::DIMENSIONS,
900 'size_units' => ['px', 'em', '%'],
901 'selectors' => [
902 '{{WRAPPER}} .upk-banner-wrap .upk-sub-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
903 ],
904 ]
905 );
906
907 $this->add_responsive_control(
908 'sub_title_margin',
909 [
910 'label' => esc_html__('Margin', 'ultimate-post-kit'),
911 'type' => Controls_Manager::DIMENSIONS,
912 'size_units' => ['px', 'em', '%'],
913 'selectors' => [
914 '{{WRAPPER}} .upk-banner-wrap .upk-sub-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
915 ],
916 ]
917 );
918
919
920 $this->add_group_control(
921 Group_Control_Typography::get_type(),
922 [
923 'name' => 'sub_title_typography',
924 'label' => esc_html__('Typography', 'ultimate-post-kit'),
925 'selector' => '{{WRAPPER}} .upk-banner-wrap .upk-sub-title',
926 ]
927 );
928
929 $this->add_group_control(
930 Group_Control_Text_Shadow::get_type(),
931 [
932 'name' => 'sub_title_text_shadow',
933 'label' => __('Text Shadow', 'ultimate-post-kit'),
934 'selector' => '{{WRAPPER}} .upk-banner-wrap .upk-sub-title',
935 ]
936 );
937
938 $this->end_controls_section();
939
940 $this->start_controls_section(
941 'section_style_text',
942 [
943 'label' => esc_html__('Text', 'ultimate-post-kit'),
944 'tab' => Controls_Manager::TAB_STYLE,
945 'condition' => [
946 'show_text' => 'yes',
947 'layout_direction!' => 'style-4',
948 'description_text!' => ''
949 ],
950 ]
951 );
952
953 $this->add_control(
954 'text_color',
955 [
956 'label' => esc_html__('Color', 'ultimate-post-kit'),
957 'type' => Controls_Manager::COLOR,
958 'selectors' => [
959 '{{WRAPPER}} .upk-banner-wrap .upk-text' => 'color: {{VALUE}};',
960 ],
961 ]
962 );
963
964 $this->add_responsive_control(
965 'text_spacing',
966 [
967 'label' => esc_html__('Margin', 'ultimate-post-kit'),
968 'type' => Controls_Manager::DIMENSIONS,
969 'size_units' => ['px', 'em', '%'],
970 'selectors' => [
971 '{{WRAPPER}} .upk-banner-wrap .upk-text' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
972 ],
973 ]
974 );
975
976 $this->add_group_control(
977 Group_Control_Typography::get_type(),
978 [
979 'name' => 'text_typography',
980 'label' => esc_html__('Typography', 'ultimate-post-kit'),
981 'selector' => '{{WRAPPER}} .upk-banner-wrap .upk-text',
982 ]
983 );
984
985 $this->end_controls_section();
986
987 $this->start_controls_section(
988 'section_style_link_btn',
989 [
990 'label' => esc_html__('Read More', 'ultimate-post-kit'),
991 'tab' => Controls_Manager::TAB_STYLE,
992 'condition' => [
993 'readmore' => 'yes',
994 'readmore_text!' => ''
995 ]
996 ]
997 );
998
999
1000 $this->start_controls_tabs('tabs_link_btn_style');
1001
1002 $this->start_controls_tab(
1003 'tab_link_btn_normal',
1004 [
1005 'label' => esc_html__('Normal', 'ultimate-post-kit'),
1006 ]
1007 );
1008
1009 $this->add_control(
1010 'link_btn_color',
1011 [
1012 'label' => esc_html__('Color', 'ultimate-post-kit'),
1013 'type' => Controls_Manager::COLOR,
1014 'selectors' => [
1015 '{{WRAPPER}} .upk-banner-wrap .upk-buy-btn a' => 'color: {{VALUE}};',
1016 '{{WRAPPER}} .upk-banner-wrap .upk-buy-btn a svg' => 'fill: {{VALUE}};',
1017 ],
1018 ]
1019 );
1020
1021 $this->add_group_control(
1022 Group_Control_Background::get_type(),
1023 [
1024 'name' => 'link_btn_background',
1025 'selector' => '{{WRAPPER}} .upk-banner-wrap .upk-buy-btn a',
1026 ]
1027 );
1028
1029 $this->add_group_control(
1030 Group_Control_Border::get_type(),
1031 [
1032 'name' => 'link_btn_border',
1033 'selector' => '{{WRAPPER}} .upk-banner-wrap .upk-buy-btn a',
1034 ]
1035 );
1036
1037 $this->add_responsive_control(
1038 'link_btn_border_radius',
1039 [
1040 'label' => esc_html__('Border Radius', 'ultimate-post-kit'),
1041 'type' => Controls_Manager::DIMENSIONS,
1042 'size_units' => ['px', '%'],
1043 'selectors' => [
1044 '{{WRAPPER}} .upk-banner-wrap .upk-buy-btn a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1045 ],
1046 ]
1047 );
1048
1049 $this->add_responsive_control(
1050 'link_btn_padding',
1051 [
1052 'label' => esc_html__('Padding', 'ultimate-post-kit'),
1053 'type' => Controls_Manager::DIMENSIONS,
1054 'size_units' => ['px', 'em', '%'],
1055 'selectors' => [
1056 '{{WRAPPER}} .upk-banner-wrap .upk-buy-btn a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1057 ],
1058 ]
1059 );
1060
1061 $this->add_responsive_control(
1062 'link_btn_margin',
1063 [
1064 'label' => esc_html__('Margin', 'ultimate-post-kit'),
1065 'type' => Controls_Manager::DIMENSIONS,
1066 'size_units' => ['px', 'em', '%'],
1067 'selectors' => [
1068 '{{WRAPPER}} .upk-banner-wrap .upk-buy-btn' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1069 ],
1070 ]
1071 );
1072
1073 $this->add_group_control(
1074 Group_Control_Box_Shadow::get_type(),
1075 [
1076 'name' => 'link_btn_shadow',
1077 'selector' => '{{WRAPPER}} .upk-banner-wrap .upk-buy-btn a',
1078 ]
1079 );
1080
1081 $this->add_group_control(
1082 Group_Control_Typography::get_type(),
1083 [
1084 'name' => 'link_btn_typography',
1085 'label' => esc_html__('Typography', 'ultimate-post-kit'),
1086 'selector' => '{{WRAPPER}} .upk-banner-wrap .upk-buy-btn a',
1087 ]
1088 );
1089
1090 $this->end_controls_tab();
1091
1092 $this->start_controls_tab(
1093 'tab_link_btn_hover',
1094 [
1095 'label' => esc_html__('Hover', 'ultimate-post-kit'),
1096 ]
1097 );
1098
1099 $this->add_control(
1100 'link_btn_hover_color',
1101 [
1102 'label' => esc_html__('Color', 'ultimate-post-kit'),
1103 'type' => Controls_Manager::COLOR,
1104 'selectors' => [
1105 '{{WRAPPER}} .upk-banner-wrap .upk-buy-btn a:hover' => 'color: {{VALUE}};',
1106 '{{WRAPPER}} .upk-banner-wrap .upk-buy-btn a:hover svg' => 'fill: {{VALUE}};',
1107 ],
1108 ]
1109 );
1110
1111 $this->add_group_control(
1112 Group_Control_Background::get_type(),
1113 [
1114 'name' => 'link_btn_hover_background',
1115 'selector' => '{{WRAPPER}} .upk-banner-wrap .upk-buy-btn a:hover',
1116 ]
1117 );
1118
1119 $this->add_control(
1120 'link_btn_hover_border_color',
1121 [
1122 'label' => esc_html__('Border Color', 'ultimate-post-kit'),
1123 'type' => Controls_Manager::COLOR,
1124 'condition' => [
1125 'link_btn_border_border!' => '',
1126 ],
1127 'selectors' => [
1128 '{{WRAPPER}} .upk-banner-wrap .upk-buy-btn a:hover' => 'border-color: {{VALUE}};',
1129 ],
1130 ]
1131 );
1132
1133 $this->add_control(
1134 'readmore_hover_animation',
1135 [
1136 'label' => esc_html__( 'Animation', 'ultimate-post-kit' ),
1137 'type' => Controls_Manager::HOVER_ANIMATION,
1138 ]
1139 );
1140
1141 $this->end_controls_tab();
1142
1143 $this->end_controls_tabs();
1144
1145 $this->end_controls_section();
1146
1147
1148 $this->start_controls_section(
1149 'section_style_badge',
1150 [
1151 'label' => esc_html__('Badge', 'ultimate-post-kit'),
1152 'tab' => Controls_Manager::TAB_STYLE,
1153 'conditions' => [
1154 'relation' => 'or',
1155 'terms' => [
1156 [
1157 'name' => 'show_badge',
1158 'value' => 'yes'
1159 ],
1160 [
1161 'name' => 'show_banner_size',
1162 'value' => 'yes'
1163 ],
1164 ]
1165 ],
1166 ]
1167 );
1168
1169
1170 $this->start_controls_tabs('tabs_badge_style');
1171
1172 $this->start_controls_tab(
1173 'tab_badge_normal',
1174 [
1175 'label' => esc_html__('Primary', 'ultimate-post-kit'),
1176 'condition' => [
1177 'show_badge' => 'yes',
1178 ],
1179 ]
1180 );
1181
1182 $this->add_control(
1183 'badge_color',
1184 [
1185 'label' => esc_html__('Color', 'ultimate-post-kit'),
1186 'type' => Controls_Manager::COLOR,
1187 'selectors' => [
1188 '{{WRAPPER}} .upk-banner-wrap .upk-discount' => 'color: {{VALUE}};',
1189 ],
1190 'condition' => [
1191 'show_badge' => 'yes',
1192 ],
1193 ]
1194 );
1195
1196 $this->add_group_control(
1197 Group_Control_Background::get_type(),
1198 [
1199 'name' => 'badge_background',
1200 'selector' => '{{WRAPPER}} .upk-banner-wrap .upk-discount',
1201 'condition' => [
1202 'show_badge' => 'yes',
1203 ],
1204 ]
1205 );
1206
1207 $this->add_group_control(
1208 Group_Control_Border::get_type(),
1209 [
1210 'name' => 'badge_border',
1211 'selector' => '{{WRAPPER}} .upk-banner-wrap .upk-discount',
1212 'condition' => [
1213 'show_badge' => 'yes',
1214 ],
1215 ]
1216 );
1217
1218 $this->add_responsive_control(
1219 'badge_border_radius',
1220 [
1221 'label' => esc_html__('Border Radius', 'ultimate-post-kit'),
1222 'type' => Controls_Manager::DIMENSIONS,
1223 'size_units' => ['px', '%'],
1224 'selectors' => [
1225 '{{WRAPPER}} .upk-banner-wrap .upk-discount' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1226 ],
1227 'condition' => [
1228 'show_badge' => 'yes',
1229 ],
1230 ]
1231 );
1232
1233 $this->add_responsive_control(
1234 'badge_padding',
1235 [
1236 'label' => esc_html__('Padding', 'ultimate-post-kit'),
1237 'type' => Controls_Manager::DIMENSIONS,
1238 'size_units' => ['px', 'em', '%'],
1239 'selectors' => [
1240 '{{WRAPPER}} .upk-banner-wrap .upk-discount' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1241 ],
1242 'condition' => [
1243 'show_badge' => 'yes',
1244 ],
1245 ]
1246 );
1247
1248 $this->add_responsive_control(
1249 'badge_margin',
1250 [
1251 'label' => esc_html__('Margin', 'ultimate-post-kit'),
1252 'type' => Controls_Manager::DIMENSIONS,
1253 'size_units' => ['px', 'em', '%'],
1254 'selectors' => [
1255 '{{WRAPPER}} .upk-banner-wrap .upk-discount' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1256 ],
1257 'condition' => [
1258 'show_badge' => 'yes',
1259 ],
1260 ]
1261 );
1262
1263 $this->add_group_control(
1264 Group_Control_Box_Shadow::get_type(),
1265 [
1266 'name' => 'badge_shadow',
1267 'selector' => '{{WRAPPER}} .upk-banner-wrap .upk-discount',
1268 'condition' => [
1269 'show_badge' => 'yes',
1270 ],
1271 ]
1272 );
1273
1274 $this->add_group_control(
1275 Group_Control_Typography::get_type(),
1276 [
1277 'name' => 'badge_typography',
1278 'label' => esc_html__('Typography', 'ultimate-post-kit'),
1279 'selector' => '{{WRAPPER}} .upk-banner-wrap .upk-discount',
1280 'condition' => [
1281 'show_badge' => 'yes',
1282 ],
1283 ]
1284 );
1285
1286 $this->end_controls_tab();
1287
1288 $this->start_controls_tab(
1289 'tab_badge_banner_size',
1290 [
1291 'label' => esc_html__('Secondary', 'ultimate-post-kit'),
1292 'condition' => [
1293 'show_banner_size' => 'yes',
1294 ],
1295 ]
1296 );
1297
1298 $this->add_control(
1299 'banner_size_color',
1300 [
1301 'label' => esc_html__('Color', 'ultimate-post-kit'),
1302 'type' => Controls_Manager::COLOR,
1303 'selectors' => [
1304 '{{WRAPPER}} .upk-banner-wrap .upk-banner-size-text' => 'color: {{VALUE}};',
1305 ],
1306 'condition' => [
1307 'show_banner_size' => 'yes',
1308 ],
1309 ]
1310 );
1311
1312 $this->add_group_control(
1313 Group_Control_Background::get_type(),
1314 [
1315 'name' => 'banner_size_background',
1316 'selector' => '{{WRAPPER}} .upk-banner-wrap .upk-banner-size-text',
1317 'condition' => [
1318 'show_banner_size' => 'yes',
1319 ],
1320 ]
1321 );
1322
1323 $this->add_group_control(
1324 Group_Control_Border::get_type(),
1325 [
1326 'name' => 'banner_size_border',
1327 'selector' => '{{WRAPPER}} .upk-banner-wrap .upk-banner-size-text',
1328 'condition' => [
1329 'show_banner_size' => 'yes',
1330 ],
1331 ]
1332 );
1333
1334 $this->add_responsive_control(
1335 'banner_size_border_radius',
1336 [
1337 'label' => esc_html__('Border Radius', 'ultimate-post-kit'),
1338 'type' => Controls_Manager::DIMENSIONS,
1339 'size_units' => ['px', '%'],
1340 'selectors' => [
1341 '{{WRAPPER}} .upk-banner-wrap .upk-banner-size-text' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1342 ],
1343 'condition' => [
1344 'show_banner_size' => 'yes',
1345 ],
1346 ]
1347 );
1348
1349 $this->add_responsive_control(
1350 'banner_size_padding',
1351 [
1352 'label' => esc_html__('Padding', 'ultimate-post-kit'),
1353 'type' => Controls_Manager::DIMENSIONS,
1354 'size_units' => ['px', 'em', '%'],
1355 'selectors' => [
1356 '{{WRAPPER}} .upk-banner-wrap .upk-banner-size-text' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1357 ],
1358 'condition' => [
1359 'show_banner_size' => 'yes',
1360 ],
1361 ]
1362 );
1363
1364 $this->add_responsive_control(
1365 'banner_size_margin',
1366 [
1367 'label' => esc_html__('Margin', 'ultimate-post-kit'),
1368 'type' => Controls_Manager::DIMENSIONS,
1369 'size_units' => ['px', 'em', '%'],
1370 'selectors' => [
1371 '{{WRAPPER}} .upk-banner-wrap .upk-banner-size-text' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1372 ],
1373 'condition' => [
1374 'show_banner_size' => 'yes',
1375 ],
1376 ]
1377 );
1378
1379 $this->add_group_control(
1380 Group_Control_Box_Shadow::get_type(),
1381 [
1382 'name' => 'banner_size_shadow',
1383 'selector' => '{{WRAPPER}} .upk-banner-wrap .upk-banner-size-text',
1384 'condition' => [
1385 'show_banner_size' => 'yes',
1386 ],
1387 ]
1388 );
1389
1390 $this->add_group_control(
1391 Group_Control_Typography::get_type(),
1392 [
1393 'name' => 'banner_size_typography',
1394 'label' => esc_html__('Typography', 'ultimate-post-kit'),
1395 'selector' => '{{WRAPPER}} .upk-banner-wrap .upk-banner-size-text',
1396 'condition' => [
1397 'show_banner_size' => 'yes',
1398 ],
1399 ]
1400 );
1401
1402 $this->end_controls_tab();
1403
1404 $this->end_controls_tabs();
1405
1406 $this->end_controls_section();
1407 }
1408
1409
1410 public function render_readmore() {
1411 $settings = $this->get_settings_for_display();
1412
1413 if ( ! $settings['readmore'] ) {
1414 return;
1415 }
1416
1417 $this->add_render_attribute(
1418 [
1419 'readmore-link' => [
1420 'class' => [
1421 'upk-banner-readmore',
1422 $settings['readmore_hover_animation'] ? 'elementor-animation-' . $settings['readmore_hover_animation'] : '',
1423 ],
1424 'href' => isset($settings['readmore_link']['url']) ? esc_url($settings['readmore_link']['url']) : '#',
1425 'target' => $settings['readmore_link']['is_external'] ? '_blank' : '_self'
1426 ]
1427 ], '', '', true
1428 );
1429
1430 ?>
1431 <?php if (( ! empty( $settings['readmore_link']['url'] )) && ( $settings['readmore'] )): ?>
1432 <div class="upk-buy-btn">
1433 <a <?php $this->print_render_attribute_string( 'readmore-link' ); ?>>
1434 <?php echo esc_html($settings['readmore_text']); ?>
1435 <?php if ($settings['readmore_icon']['value']) : ?>
1436 <span class="upk-button-icon-align-<?php echo esc_attr($settings['icon_align']); ?>">
1437 <?php Icons_Manager::render_icon( $settings['readmore_icon'], [ 'aria-hidden' => 'true', 'class' => 'fa-fw' ] ); ?>
1438 </span>
1439 <?php endif; ?>
1440 </a>
1441 </div>
1442 <?php endif;
1443 }
1444
1445 public function render_banner_content() {
1446 $settings = $this->get_settings_for_display();
1447
1448 ?>
1449
1450 <div class="upk-content">
1451 <div class="upk-content-inner">
1452 <?php if ($settings['show_title'] and $settings['title_text']) : ?>
1453 <<?php echo esc_attr(Utils::get_valid_html_tag($settings['title_size'])); ?> class="upk-title">
1454 <?php echo wp_kses_post($settings['title_text'], ultimate_post_kit_title_tags('title_text')); ?>
1455 </<?php echo esc_attr(Utils::get_valid_html_tag($settings['title_size'])); ?>>
1456 <?php endif; ?>
1457
1458 <?php if ($settings['sub_title_text'] and 'yes' == $settings['show_sub_title']) : ?>
1459 <div class="upk-sub-title">
1460 <?php echo esc_html($settings['sub_title_text']); ?>
1461 </div>
1462 <?php endif; ?>
1463 </div>
1464
1465 <?php if ($settings['description_text'] and 'yes' == $settings['show_text'] and $settings['layout_direction'] !== 'style-4') : ?>
1466 <div class="upk-text">
1467 <?php echo wp_kses_post($settings['description_text'], ultimate_post_kit_title_tags('description_text')); ?>
1468 </div>
1469 <?php endif; ?>
1470
1471 <?php $this->render_readmore(); ?>
1472 </div>
1473
1474 <?php if ('yes' == $settings['show_badge'] and $settings['badge_text']) : ?>
1475 <div class="upk-discount">
1476 <?php echo esc_html($settings['badge_text']); ?>
1477 </div>
1478 <?php endif; ?>
1479
1480 <?php if ('yes' == $settings['show_banner_size'] and $settings['banner_size_text']) : ?>
1481 <div class="upk-banner-size-text">
1482 <span>
1483 <?php echo esc_html($settings['banner_size_text']); ?>
1484 </span>
1485 </div>
1486 <?php endif; ?>
1487
1488 <?php
1489 }
1490
1491 protected function render() {
1492 $settings = $this->get_settings_for_display();
1493
1494 $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'] . '']);
1495
1496 ?>
1497 <div <?php $this->print_render_attribute_string('upk-banner'); ?>>
1498 <div class="upk-item">
1499 <?php $this->render_banner_content(); ?>
1500 </div>
1501 </div>
1502 <?php
1503 }
1504 }
1505