PluginProbe
UiCore Elements – Free widgets and templates for Elementor / 1.2.1
UiCore Elements – Free widgets and templates for Elementor v1.2.1
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.2.1, at includes/widgets/gallery-slider.php

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