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 +40 -29 1.0.3 → 1.3.18 View file →
@@ -1,11 +1,14 @@
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;
7 9 use UiCoreElements\Utils\Grid_Trait;
10 +use UicoreElements\Utils\Item_Style_Component;
8 11
9 12 use function PHPSTORM_META\map;
10 13
11 14 defined('ABSPATH') || exit();
@@ -21,8 +24,9 @@
21 24 {
22 25 use Testimonial_Trait;
23 26 use Animation_Trait;
24 27 use Grid_Trait;
28 + use Item_Style_Component;
25 29
26 30 public function get_name()
27 31 {
28 32 return 'uicore-testimonial-grid';
@@ -40,23 +44,24 @@
40 44 return ['uicore'];
41 45 }
42 46 public function get_keywords()
43 47 {
44 - return ['testimonial', 'review', 'services', 'cards', 'box', 'features', 'testimonial', 'client', 'grid'];
48 + return ['testimonial', 'review', 'services', 'cards', 'box', 'features', 'client', 'grid'];
45 49 }
46 50 public function get_styles()
47 51 {
48 - return [
52 + $styles = [
49 53 'testimonial-grid',
54 + 'grid',
50 55 'animation', // hover animations
51 56 'entrance', // entrance basic style
52 - 'e-animations' => [ // entrance animations
53 - 'condition' => [
54 - 'animation_assets' => 'false'
55 - ],
57 + ];
58 + if (!class_exists('\UiCore\Core') && !class_exists('\UiCoreAnimate\Base')) {
59 + $styles['e-animations'] = [ // entrance animations
56 60 'external' => true,
57 - ]
58 - ];
61 + ];
62 + }
63 + return $styles;
59 64 }
60 65 public function get_scripts()
61 66 {
62 67 return [
@@ -71,12 +76,17 @@
71 76 ],
72 77 ]
73 78 ];
74 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 + }
75 85 protected function register_controls()
76 86 {
77 87
78 - $this->register_testimonial_repeater_controls('Testimonial Grid Items'); // Repeater Controls
88 + $this->TRAIT_register_testimonial_repeater_controls('Testimonial Grid Items'); // Repeater Controls
79 89
80 90 $this->start_controls_section( // Specific Additional Grid Controls
81 91 'section_review_additional_settings',
82 92 [
@@ -84,29 +94,27 @@
84 94 'tab' => Controls_Manager::TAB_CONTENT,
85 95 ]
86 96 );
87 97
88 - $this->TRAIT_register_entrace_asset_helper(); // Animation asset condition
89 - $this->register_specific_testimonial_controls('layout');
90 - $this->register_grid_layout_controls(); // column, gaps and masonry
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
91 101
92 - $this->register_testimonial_additional_controls(); // Content Additional Controls
93 -
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->register_all_grid_item_style_controls();
112 + $this->TRAIT_register_all_item_style_controls(false);
105 113
106 114 $this->end_controls_section();
107 115
108 - $this->register_style_controls(); // Other Components Style Controls
116 + $this->TRAIT_register_style_controls(); // Other Components Style Controls
109 117
110 118 $this->start_controls_section(
111 119 'section_style_animations',
112 120 [
@@ -114,9 +122,9 @@
114 122 'tab' => Controls_Manager::TAB_STYLE,
115 123 ]
116 124 );
117 125
118 - $this->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->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());