PluginProbe
UiCore Elements – Free widgets and templates for Elementor / 1.3.18
UiCore Elements – Free widgets and templates for Elementor v1.3.18
1.3.18 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 All 42 releases
← All changes | includes/widgets/testimonial-grid.php +30 -19 1.0.5 → 1.3.18 View file →
@@ -1,6 +1,8 @@
1 1 <?php
2 +
2 3 namespace UiCoreElements;
4 +
3 5 use Elementor\Controls_Manager;
4 6 use UiCoreElements\UiCoreWidget;
5 7 use UiCoreElements\Utils\Testimonial_Trait;
6 8 use UiCoreElements\Utils\Animation_Trait;
@@ -48,12 +50,13 @@
48 50 public function get_styles()
49 51 {
50 52 $styles = [
51 53 'testimonial-grid',
54 + 'grid',
52 55 'animation', // hover animations
53 56 'entrance', // entrance basic style
54 57 ];
55 - if(!class_exists('\UiCore\Core') && !class_exists('\UiCoreAnimate\Base')){
58 + if (!class_exists('\UiCore\Core') && !class_exists('\UiCoreAnimate\Base')) {
56 59 $styles['e-animations'] = [ // entrance animations
57 60 'external' => true,
58 61 ];
59 62 }
@@ -61,9 +64,9 @@
61 64 }
62 65 public function get_scripts()
63 66 {
64 67 return [
65 - 'utils/global-testimonial' => [
68 + 'testimonial' => [
66 69 'condition' => [
67 70 'layout' => 'layout_5'
68 71 ],
69 72 ],
@@ -73,8 +76,13 @@
73 76 ],
74 77 ]
75 78 ];
76 79 }
80 + public function has_widget_inner_wrapper(): bool
81 + {
82 + // TODO: remove after Optmized Markup experiment is merged to the core
83 + return ! \Elementor\Plugin::$instance->experiments->is_feature_active('e_optimized_markup');
84 + }
77 85 protected function register_controls()
78 86 {
79 87
80 88 $this->TRAIT_register_testimonial_repeater_controls('Testimonial Grid Items'); // Repeater Controls
@@ -86,23 +94,23 @@
86 94 'tab' => Controls_Manager::TAB_CONTENT,
87 95 ]
88 96 );
89 97
90 - $this->TRAIT_register_specific_testimonial_controls('layout');
91 - $this->TRAIT_register_grid_layout_controls();
92 - $this->TRAIT_register_testimonial_additional_controls(); // Content Additional Controls
98 + $this->TRAIT_register_specific_testimonial_controls('layout');
99 + $this->TRAIT_register_grid_layout_controls();
100 + $this->TRAIT_register_testimonial_additional_controls(); // Content Additional Controls
93 101
94 102 $this->end_controls_section();
95 103
96 104 $this->start_controls_section(
97 - 'section_style_review_items',
98 - [
99 - 'label' => esc_html__( 'Items', 'uicore-elements' ),
100 - 'tab' => Controls_Manager::TAB_STYLE,
101 - ]
102 - );
105 + 'section_style_review_items',
106 + [
107 + 'label' => esc_html__('Items', 'uicore-elements'),
108 + 'tab' => Controls_Manager::TAB_STYLE,
109 + ]
110 + );
103 111
104 - $this->TRAIT_register_all_item_style_controls(false);
112 + $this->TRAIT_register_all_item_style_controls(false);
105 113
106 114 $this->end_controls_section();
107 115
108 116 $this->TRAIT_register_style_controls(); // Other Components Style Controls
@@ -114,9 +122,9 @@
114 122 'tab' => Controls_Manager::TAB_STYLE,
115 123 ]
116 124 );
117 125
118 - $this->TRAIT_register_testimonial_animation_controls();
126 + $this->TRAIT_register_testimonial_animation_controls();
119 127
120 128 $this->end_controls_section();
121 129 }
122 130 public function render()
@@ -122,16 +130,19 @@
122 130 public function render()
123 131 {
124 132 $settings = $this->get_settings_for_display();
125 133 $layout = $settings['layout'];
134 + $masonry = $this->is_option('masonry', 'yes')
135 + ? 'ui-e-maso'
136 + : '';
126 137
127 - $this->add_render_attribute('review-card', 'class', 'ui-e-grid');
128 - ?>
138 + $this->add_render_attribute('review-card', 'class', ['ui-e-grid', $masonry]);
139 +?>
129 140 <div <?php $this->print_render_attribute_string('review-card'); ?>>
130 - <?php foreach ( $settings['review_items'] as $index => $item ) : ?>
131 - <?php $this->TRAIT_render_review_item($item, $layout); ?>
141 + <?php foreach ($settings['review_items'] as $index => $item) : ?>
142 + <?php $this->TRAIT_render_review_item($item, $layout); ?>
132 143 <?php endforeach; ?>
133 144 </div>
134 - <?php
145 +<?php
135 146 }
136 147 }
137 -\Elementor\Plugin::instance()->widgets_manager->register(new TestimonialGrid());
148 +\Elementor\Plugin::instance()->widgets_manager->register(new TestimonialGrid());