| @@ -1,5 +1,6 @@ | ||
| 1 | 1 | <?php |
| 2 | + | |
| 2 | 3 | namespace UiCoreElements; |
| 3 | 4 | |
| 4 | 5 | defined('ABSPATH') || exit(); |
| 5 | 6 | |
| @@ -13,11 +14,8 @@ | ||
| 13 | 14 | */ |
| 14 | 15 | |
| 15 | 16 | class TestimonialSlider extends TestimonialCarousel |
| 16 | 17 | { |
| 17 | - | |
| 18 | - public $is_slider = true; | |
| 19 | - | |
| 20 | 18 | public function get_name() |
| 21 | 19 | { |
| 22 | 20 | return 'uicore-testimonial-slider'; |
| 23 | 21 | } |
| @@ -28,30 +26,38 @@ | ||
| 28 | 26 | public function get_icon() |
| 29 | 27 | { |
| 30 | 28 | return 'eicon-testimonial ui-e-widget'; |
| 31 | 29 | } |
| 30 | + public function get_keywords() | |
| 31 | + { | |
| 32 | + return ['testimonial', 'review', 'services', 'cards', 'box', 'client', 'slider']; | |
| 33 | + } | |
| 32 | 34 | public function get_styles() |
| 33 | 35 | { |
| 34 | - return [ | |
| 35 | - 'testimonial-slider', | |
| 36 | - 'animation', // hover animations | |
| 37 | - 'entrance', // entrance basic style | |
| 38 | - 'e-animations' => [ // entrance animations | |
| 39 | - 'condition' => [ | |
| 40 | - 'animation_assets' => 'false' | |
| 41 | - ], | |
| 42 | - 'external' => true, | |
| 43 | - ] | |
| 44 | - ]; | |
| 36 | + $styles = parent::get_styles(); | |
| 37 | + | |
| 38 | + // replace 'testimonial-carousel' for 'testimonial-slider' | |
| 39 | + unset($styles['testimonial-carousel']); | |
| 40 | + $styles[] = 'testimonial-slider'; | |
| 41 | + | |
| 42 | + return $styles; | |
| 45 | 43 | } |
| 46 | - protected function register_controls() { | |
| 44 | + protected function register_controls() | |
| 45 | + { | |
| 47 | 46 | |
| 48 | - parent::register_controls(); // keep original controls | |
| 47 | + parent::register_controls(); | |
| 48 | + $this->TRAIT_update_slider_controls(); | |
| 49 | 49 | |
| 50 | - // Control Updates | |
| 51 | - $this->update_control('h_alignment', ['default' => 'center']); | |
| 50 | + // Alignment adjustment | |
| 51 | + $this->update_control( | |
| 52 | + 'h_alignment', | |
| 53 | + [ | |
| 54 | + 'default' => 'center' | |
| 55 | + ] | |
| 56 | + ); | |
| 52 | 57 | // Default avatar size with one slide visible per time is too big, needs a decrease |
| 53 | - $this->update_control( 'avatar_size', | |
| 58 | + $this->update_control( | |
| 59 | + 'avatar_size', | |
| 54 | 60 | [ |
| 55 | 61 | 'devices' => ['desktop', 'tablet', 'mobile'], |
| 56 | 62 | 'default' => [ |
| 57 | 63 | 'size' => 10, |
| @@ -67,20 +73,21 @@ | ||
| 67 | 73 | ], |
| 68 | 74 | ] |
| 69 | 75 | ); |
| 70 | 76 | // Change default border radius to zero |
| 71 | - $this->update_control( 'item_border_radius', [ | |
| 72 | - 'default' => [ | |
| 73 | - 'top' => 0, | |
| 74 | - 'right' => 0, | |
| 75 | - 'bottom' => 0, | |
| 76 | - 'left' => 0, | |
| 77 | - 'unit' => 'px', | |
| 78 | - 'isLinked' => true, | |
| 79 | - ], | |
| 80 | - ]); | |
| 81 | - // Remove item entrance and hover animation | |
| 82 | - $this->remove_control('item_hover_animation'); | |
| 83 | - | |
| 77 | + $this->update_control( | |
| 78 | + ' | |
| 79 | + item_border_radius', | |
| 80 | + [ | |
| 81 | + 'default' => [ | |
| 82 | + 'top' => 0, | |
| 83 | + 'right' => 0, | |
| 84 | + 'bottom' => 0, | |
| 85 | + 'left' => 0, | |
| 86 | + 'unit' => 'px', | |
| 87 | + 'isLinked' => true, | |
| 88 | + ], | |
| 89 | + ] | |
| 90 | + ); | |
| 84 | 91 | } |
| 85 | 92 | } |
| 86 | -\Elementor\Plugin::instance()->widgets_manager->register(new TestimonialSlider()); | |
| 93 | +\Elementor\Plugin::instance()->widgets_manager->register(new TestimonialSlider()); | |