PluginProbe
UiCore Elements – Free widgets and templates for Elementor / 1.3.17
UiCore Elements – Free widgets and templates for Elementor v1.3.17
1.3.17 1.3.16 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 All 41 releases
uicore-elements / includes / widgets / gallery-slider.php

gallery-slider.php in UiCore Elements – Free widgets and templates for Elementor 1.3.17, at includes/widgets/gallery-slider.php

114 lines 3.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace UiCoreElements;
4
5 use Elementor\Controls_Manager;
6
7 defined('ABSPATH') || exit();
8
9 /**
10 * Gallery Slider
11 *
12 * Use Gallery Carousel as base
13 *
14 * @author Lucas Marini Falbo <lucas95@uicore.co>
15 * @since 1.0.14
16 */
17
18 class GallerySlider extends GalleryCarousel
19 {
20 public function get_name()
21 {
22 return 'uicore-gallery-slider';
23 }
24 public function get_title()
25 {
26 return esc_html__('Gallery Slider', 'uicore-elements');
27 }
28 public function get_icon()
29 {
30 return 'eicon-slides ui-e-widget';
31 }
32 public function get_styles()
33 {
34 $styles = parent::get_styles();
35
36 // replace 'gallery-carousel' for 'gallery-slider'
37 unset($styles['gallery-carousel']);
38 $styles[] = 'gallery-slider';
39
40 return $styles;
41 }
42 // TODO: remove after Optmized Markup experiment is merged to the core
43 public function has_widget_inner_wrapper(): bool
44 {
45 return true;
46 }
47 protected function register_controls()
48 {
49 parent::register_controls();
50 $this->TRAIT_update_slider_controls();
51
52 // Remove conditions from image height and image style section
53 $this->update_responsive_control(
54 'image_height',
55 [
56 'conditions' => false,
57 ]
58 );
59 $this->update_responsive_control(
60 'style_image_section',
61 [
62 'conditions' => false,
63 ]
64 );
65
66 // Remove item active state styles
67 $this->remove_control('tab_item_active');
68 $this->remove_control('item_active_background');
69 $this->remove_control('item_active_border_color');
70 $this->remove_control('item_active_box_shadow');
71
72 // Remove controls that are meant for carousel, not slide type widgets
73 $this->remove_control('main_image');
74
75 // Add vertical content alignment control
76 $this->start_injection([
77 'of' => 'layout',
78 'at' => 'after',
79 ]);
80
81 $this->add_responsive_control(
82 'content_v_alignment',
83 [
84 'label' => __('Vertical Alignment', 'uicore-elements'),
85 'type' => Controls_Manager::CHOOSE,
86 'default' => 'start',
87 'options' => [
88 'start' => [
89 'title' => __('Start', 'uicore-elements'),
90 'icon' => 'eicon-align-start-v',
91 ],
92 'center' => [
93 'title' => __('Center', 'uicore-elements'),
94 'icon' => 'eicon-align-center-v',
95 ],
96 'end' => [
97 'title' => __('Bottom', 'uicore-elements'),
98 'icon' => 'eicon-align-end-v',
99 ],
100 ],
101 'condition' => [
102 'layout' => 'ui-e-overlay'
103 ],
104 'selectors' => [
105 '{{WRAPPER}} .ui-e-content' => 'justify-content: {{VALUE}};',
106 ]
107 ]
108 );
109
110 $this->end_injection();
111 }
112 }
113 \Elementor\Plugin::instance()->widgets_manager->register(new GallerySlider());
114