| 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(); |
| 46 |
$this->TRAIT_update_slider_controls(); |
| 47 |
|
| 48 |
// Alignment adjustment |
| 49 |
$this->update_control( |
| 50 |
'h_alignment', |
| 51 |
[ |
| 52 |
'default' => 'center' |
| 53 |
] |
| 54 |
); |
| 55 |
// Default avatar size with one slide visible per time is too big, needs a decrease |
| 56 |
$this->update_control( |
| 57 |
'avatar_size', |
| 58 |
[ |
| 59 |
'devices' => ['desktop', 'tablet', 'mobile'], |
| 60 |
'default' => [ |
| 61 |
'size' => 10, |
| 62 |
'unit' => '%' |
| 63 |
], |
| 64 |
'tablet_default' => [ |
| 65 |
'size' => 15, |
| 66 |
'unit' => '%' |
| 67 |
], |
| 68 |
'mobile_default' => [ |
| 69 |
'size' => 40, |
| 70 |
'unit' => '%' |
| 71 |
], |
| 72 |
] |
| 73 |
); |
| 74 |
// Change default border radius to zero |
| 75 |
$this->update_control( ' |
| 76 |
item_border_radius', |
| 77 |
[ |
| 78 |
'default' => [ |
| 79 |
'top' => 0, |
| 80 |
'right' => 0, |
| 81 |
'bottom' => 0, |
| 82 |
'left' => 0, |
| 83 |
'unit' => 'px', |
| 84 |
'isLinked' => true, |
| 85 |
], |
| 86 |
] |
| 87 |
); |
| 88 |
|
| 89 |
} |
| 90 |
} |
| 91 |
\Elementor\Plugin::instance()->widgets_manager->register(new TestimonialSlider()); |