PluginProbe
UiCore Elements – Free widgets and templates for Elementor / 1.3.17
UiCore Elements – Free widgets and templates for Elementor v1.3.17
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
← All changes | includes/widgets/gallery-grid.php +56 -50 1.0.161.3.17 View file →
@@ -1,5 +1,6 @@
1 1 <?php
2 +
2 3 namespace UiCoreElements;
3 4
4 5 use Elementor\Controls_Manager;
5 6 use Elementor\Group_Control_Background;
@@ -58,9 +59,9 @@
58 59 ],
59 60 'animation', // hover animations
60 61 'entrance', // entrance basic style
61 62 ];
62 - if(!class_exists('\UiCore\Core') && !class_exists('\UiCoreAnimate\Base')){
63 + if (!class_exists('\UiCore\Core') && !class_exists('\UiCoreAnimate\Base')) {
63 64 $styles['e-animations'] = [ // entrance animations
64 65 'external' => true,
65 66 ];
66 67 }
@@ -80,8 +81,13 @@
80 81 ],
81 82 ]
82 83 ];
83 84 }
85 + public function has_widget_inner_wrapper(): bool
86 + {
87 + // TODO: remove after Optmized Markup experiment is merged to the core
88 + return ! \Elementor\Plugin::$instance->experiments->is_feature_active('e_optimized_markup');
89 + }
84 90 protected function register_controls()
85 91 {
86 92 $this->TRAIT_register_gallery_repeater_controls('Content');
87 93 $this->TRAIT_register_additional_controls();
@@ -93,9 +99,9 @@
93 99 'tab' => Controls_Manager::TAB_CONTENT,
94 100 ]
95 101 );
96 102
97 - $this->TRAIT_register_grid_layout_controls();
103 + $this->TRAIT_register_grid_layout_controls();
98 104
99 105 $this->end_controls_section();
100 106
101 107 $this->start_controls_section(
@@ -105,9 +111,9 @@
105 111 'tab' => Controls_Manager::TAB_STYLE,
106 112 ]
107 113 );
108 114
109 - $this->TRAIT_register_all_item_style_controls(false);
115 + $this->TRAIT_register_all_item_style_controls(false);
110 116
111 117 $this->end_controls_section();
112 118
113 119 $this->TRAIT_register_filters_style_controls();
@@ -140,10 +146,10 @@
140 146 'bottom' => 10,
141 147 'left' => 10,
142 148 ],
143 149 'selectors' => [
144 - '{{WRAPPER}} .ui-e-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
145 - ],
150 + '{{WRAPPER}} .ui-e-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
151 + ],
146 152 ]
147 153 );
148 154 $this->update_control(
149 155 'item_border_radius',
@@ -178,29 +184,29 @@
178 184 'of' => 'item_border_border',
179 185 'at' => 'before',
180 186 ]);
181 187
182 - // normal background controls
183 - $this->add_group_control(
184 - Group_Control_Background::get_type(),
185 - [
186 - 'name' => 'item_gallery_background',
187 - 'selector' => '{{WRAPPER}} .ui-e-item',
188 - 'condition' => [
189 - 'layout' => '',
190 - ]
188 + // normal background controls
189 + $this->add_group_control(
190 + Group_Control_Background::get_type(),
191 + [
192 + 'name' => 'item_gallery_background',
193 + 'selector' => '{{WRAPPER}} .ui-e-item',
194 + 'condition' => [
195 + 'layout' => '',
191 196 ]
192 - );
193 - $this->add_group_control(
194 - Group_Control_Background::get_type(),
195 - [
196 - 'name' => 'item_content_background',
197 - 'selector' => '{{WRAPPER}} .ui-e-content',
198 - 'condition' => [
199 - 'layout' => 'ui-e-overlay',
200 - ]
197 + ]
198 + );
199 + $this->add_group_control(
200 + Group_Control_Background::get_type(),
201 + [
202 + 'name' => 'item_content_background',
203 + 'selector' => '{{WRAPPER}} .ui-e-content',
204 + 'condition' => [
205 + 'layout' => 'ui-e-overlay',
201 206 ]
202 - );
207 + ]
208 + );
203 209
204 210 $this->end_injection();
205 211
206 212 $this->start_injection([
@@ -207,29 +213,29 @@
207 213 'of' => 'item_hover_border_color',
208 214 'at' => 'before',
209 215 ]);
210 216
211 - // hover background controls
212 - $this->add_group_control(
213 - Group_Control_Background::get_type(),
214 - [
215 - 'name' => 'item_gallery_hover_background',
216 - 'selector' => '{{WRAPPER}} .ui-e-item:hover',
217 - 'condition' => [
218 - 'layout' => '',
219 - ]
217 + // hover background controls
218 + $this->add_group_control(
219 + Group_Control_Background::get_type(),
220 + [
221 + 'name' => 'item_gallery_hover_background',
222 + 'selector' => '{{WRAPPER}} .ui-e-item:hover',
223 + 'condition' => [
224 + 'layout' => '',
220 225 ]
221 - );
222 - $this->add_group_control(
223 - Group_Control_Background::get_type(),
224 - [
225 - 'name' => 'item_content_hover_background',
226 - 'selector' => '{{WRAPPER}} .ui-e-item:hover .ui-e-content',
227 - 'condition' => [
228 - 'layout' => 'ui-e-overlay',
229 - ]
226 + ]
227 + );
228 + $this->add_group_control(
229 + Group_Control_Background::get_type(),
230 + [
231 + 'name' => 'item_content_hover_background',
232 + 'selector' => '{{WRAPPER}} .ui-e-item:hover .ui-e-content',
233 + 'condition' => [
234 + 'layout' => 'ui-e-overlay',
230 235 ]
231 - );
236 + ]
237 + );
232 238
233 239 $this->end_injection();
234 240 }
235 241 public function render()
@@ -234,16 +240,16 @@
234 240 }
235 241 public function render()
236 242 {
237 243 $settings = $this->get_settings_for_display();
238 - $masonry = ( isset($settings['masonry']) && $settings['masonry'] === 'yes' ) ? 'ui-e-maso' : '';
244 + $masonry = $this->is_option('masonry', 'yes') ? 'ui-e-maso' : '';
239 245
240 246 $this->TRAIT_render_gallery_filters($settings);
241 247
242 - ?>
243 - <div class='ui-e-grid ui-e-items-wrp <?php echo esc_attr($masonry) ;?>'>
244 - <?php $this->TRAIT_render_gallery($settings); ?>
245 - </div>
246 - <?php
248 +?>
249 + <div class='ui-e-grid ui-e-items-wrp <?php echo esc_attr($masonry); ?>'>
250 + <?php $this->TRAIT_render_gallery($settings); ?>
251 + </div>
252 +<?php
247 253 }
248 254 }
249 -\Elementor\Plugin::instance()->widgets_manager->register(new GalleryGrid());
255 +\Elementor\Plugin::instance()->widgets_manager->register(new GalleryGrid());