PluginProbe
Elementor Website Builder – more than just a page builder / 3.20.2
Elementor Website Builder – more than just a page builder v3.20.2
4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 All 452 releases
← All changes | includes/widgets/image-gallery.php +6 -93 4.1.43.20.2 View file →
@@ -71,27 +71,9 @@
71 71 public function get_keywords() {
72 72 return [ 'image', 'photo', 'visual', 'gallery' ];
73 73 }
74 74
75 - protected function is_dynamic_content(): bool {
76 - return false;
77 - }
78 -
79 75 /**
80 - * Get style dependencies.
81 - *
82 - * Retrieve the list of style dependencies the widget requires.
83 - *
84 - * @since 3.24.0
85 - * @access public
86 - *
87 - * @return array Widget style dependencies.
88 - */
89 - public function get_style_depends(): array {
90 - return [ 'widget-image-gallery' ];
91 - }
92 -
93 - /**
94 76 * Get widget upsale data.
95 77 *
96 78 * Retrieve the widget promotion data.
97 79 *
@@ -110,12 +92,8 @@
110 92 'upgrade_text' => esc_html__( 'Upgrade Now', 'elementor' ),
111 93 ];
112 94 }
113 95
114 - public function has_widget_inner_wrapper(): bool {
115 - return ! Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' );
116 - }
117 -
118 96 /**
119 97 * Register image gallery widget controls.
120 98 *
121 99 * Adds different input fields to allow the user to change and customize the widget settings.
@@ -213,48 +191,8 @@
213 191 ],
214 192 'condition' => [
215 193 'gallery_link' => 'file',
216 194 ],
217 - 'assets' => [
218 - 'styles' => [
219 - [
220 - 'name' => 'e-swiper',
221 - 'conditions' => [
222 - 'terms' => [
223 - [
224 - 'name' => 'gallery_link',
225 - 'operator' => '===',
226 - 'value' => 'file',
227 - ],
228 - [
229 - 'name' => 'open_lightbox',
230 - 'operator' => '!==',
231 - 'value' => 'no',
232 - ],
233 - ],
234 - ],
235 - ],
236 - ],
237 - 'scripts' => [
238 - [
239 - 'name' => 'swiper',
240 - 'conditions' => [
241 - 'terms' => [
242 - [
243 - 'name' => 'gallery_link',
244 - 'operator' => '===',
245 - 'value' => 'file',
246 - ],
247 - [
248 - 'name' => 'open_lightbox',
249 - 'operator' => '!==',
250 - 'value' => 'no',
251 - ],
252 - ],
253 - ],
254 - ],
255 - ],
256 - ],
257 195 ]
258 196 );
259 197
260 198 $this->add_control(
@@ -282,9 +220,9 @@
282 220
283 221 $this->add_control(
284 222 'image_spacing',
285 223 [
286 - 'label' => esc_html__( 'Gap', 'elementor' ),
224 + 'label' => esc_html__( 'Spacing', 'elementor' ),
287 225 'type' => Controls_Manager::SELECT,
288 226 'options' => [
289 227 '' => esc_html__( 'Default', 'elementor' ),
290 228 'custom' => esc_html__( 'Custom', 'elementor' ),
@@ -299,9 +237,9 @@
299 237
300 238 $this->add_control(
301 239 'image_spacing_custom',
302 240 [
303 - 'label' => esc_html__( 'Custom Gap', 'elementor' ),
241 + 'label' => esc_html__( 'Custom Spacing', 'elementor' ),
304 242 'type' => Controls_Manager::SLIDER,
305 243 'size_units' => [ 'px', 'em', 'rem', 'custom' ],
306 244 'range' => [
307 245 'px' => [
@@ -366,10 +304,10 @@
366 304 [
367 305 'label' => esc_html__( 'Alignment', 'elementor' ),
368 306 'type' => Controls_Manager::CHOOSE,
369 307 'options' => [
370 - 'start' => [
371 - 'title' => esc_html__( 'Start', 'elementor' ),
308 + 'left' => [
309 + 'title' => esc_html__( 'Left', 'elementor' ),
372 310 'icon' => 'eicon-text-align-left',
373 311 ],
374 312 'center' => [
375 313 'title' => esc_html__( 'Center', 'elementor' ),
@@ -374,10 +312,10 @@
374 312 'center' => [
375 313 'title' => esc_html__( 'Center', 'elementor' ),
376 314 'icon' => 'eicon-text-align-center',
377 315 ],
378 - 'end' => [
379 - 'title' => esc_html__( 'End', 'elementor' ),
316 + 'right' => [
317 + 'title' => esc_html__( 'Right', 'elementor' ),
380 318 'icon' => 'eicon-text-align-right',
381 319 ],
382 320 'justify' => [
383 321 'title' => esc_html__( 'Justified', 'elementor' ),
@@ -383,13 +321,8 @@
383 321 'title' => esc_html__( 'Justified', 'elementor' ),
384 322 'icon' => 'eicon-text-align-justify',
385 323 ],
386 324 ],
387 - 'classes' => 'elementor-control-start-end',
388 - 'selectors_dictionary' => [
389 - 'left' => is_rtl() ? 'end' : 'start',
390 - 'right' => is_rtl() ? 'start' : 'end',
391 - ],
392 325 'default' => 'center',
393 326 'selectors' => [
394 327 '{{WRAPPER}} .gallery-item .gallery-caption' => 'text-align: {{VALUE}};',
395 328 ],
@@ -498,26 +431,6 @@
498 431 remove_filter( 'wp_get_attachment_link', [ $this, 'add_lightbox_data_to_image_link' ] );
499 432 ?>
500 433 </div>
501 434 <?php
502 - }
503 -
504 - public function render_markdown(): string {
505 - $settings = $this->get_settings_for_display();
506 - if ( empty( $settings['wp_gallery'] ) ) {
507 - return '';
508 - }
509 - $images = [];
510 - foreach ( $settings['wp_gallery'] as $image ) {
511 - $url = $image['url'] ?? '';
512 - if ( empty( $url ) ) {
513 - continue;
514 - }
515 - $alt = '';
516 - if ( ! empty( $image['id'] ) ) {
517 - $alt = get_post_meta( $image['id'], '_wp_attachment_image_alt', true );
518 - }
519 - $images[] = '![' . $alt . '](' . esc_url( $url ) . ')';
520 - }
521 - return implode( "\n\n", $images );
522 435 }
523 436 }