PluginProbe
UiCore Elements – Free widgets and templates for Elementor / 1.0.16
UiCore Elements – Free widgets and templates for Elementor v1.0.16
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 / testimonial-slider.php

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

105 lines 3.3 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 defined('ABSPATH') || exit();
5
6 /**
7 * Testimonial Slider
8 *
9 * Use Testimonial Carousel as base
10 *
11 * @author Lucas Marini Falbo <lucas@uicore.co>
12 * @since 1.0.1
13 */
14
15 class TestimonialSlider extends TestimonialCarousel
16 {
17 public function get_name()
18 {
19 return 'uicore-testimonial-slider';
20 }
21 public function get_title()
22 {
23 return esc_html__('Testimonial Slider', 'uicore-elements');
24 }
25 public function get_icon()
26 {
27 return 'eicon-testimonial ui-e-widget';
28 }
29 public function get_keywords()
30 {
31 return ['testimonial', 'review', 'services', 'cards', 'box', 'client', 'slider'];
32 }
33 public function get_styles()
34 {
35 $styles = parent::get_styles();
36
37 // replace 'testimonial-carousel' for 'testimonial-slider'
38 unset($styles['testimonial-carousel']);
39 $styles[] = 'testimonial-slider';
40
41 return $styles;
42 }
43 protected function register_controls() {
44
45 parent::register_controls(); // keep original controls
46
47 // Control Updates
48 $this->update_control('h_alignment', ['default' => 'center']);
49 // Default avatar size with one slide visible per time is too big, needs a decrease
50 $this->update_control( 'avatar_size',
51 [
52 'devices' => ['desktop', 'tablet', 'mobile'],
53 'default' => [
54 'size' => 10,
55 'unit' => '%'
56 ],
57 'tablet_default' => [
58 'size' => 15,
59 'unit' => '%'
60 ],
61 'mobile_default' => [
62 'size' => 40,
63 'unit' => '%'
64 ],
65 ]
66 );
67 // Change default border radius to zero
68 $this->update_control( 'item_border_radius', [
69 'default' => [
70 'top' => 0,
71 'right' => 0,
72 'bottom' => 0,
73 'left' => 0,
74 'unit' => 'px',
75 'isLinked' => true,
76 ],
77 ]);
78 // Add special animation slide
79 $this->update_control('animation_style',[
80 'default' => 'fade',
81 'options' => [
82 'coverflow' => esc_html__('Coverflow', 'uicore-elements'),
83 'fade' => esc_html__('Fade', 'uicore-elements'),
84 'cards' => esc_html__('Cards', 'uicore-elements'),
85 'flip' => esc_html__('Flip', 'uicore-elements'),
86 'creative' => esc_html__('Creative', 'uicore-elements'),
87 'stacked' => esc_html__('Stacked', 'uicore-elements'),
88 'circular_avatar' => esc_html__('Circular Avatar', 'uicore-elements'),
89 ]
90 ]);
91
92 // Remove item entrance and hover animation
93 $this->remove_control('animate_items');
94 $this->remove_control('item_hover_animation');
95
96 // Remove controls that are meant for carousel, not slide type widgets
97 $this->remove_responsive_control('slides_per_view');
98 $this->remove_control('show_hidden');
99 $this->remove_control('fade_edges');
100 $this->remove_control('fade_edges_alert');
101 $this->remove_control('match_height');
102 $this->remove_control('carousel_gap');
103 }
104 }
105 \Elementor\Plugin::instance()->widgets_manager->register(new TestimonialSlider());