PluginProbe
Elementor Website Builder – more than just a page builder / 3.20.0-dev2
Elementor Website Builder – more than just a page builder v3.20.0-dev2
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 4.0.7 All 451 releases
elementor / includes / widgets / image.php

image.php in Elementor Website Builder – more than just a page builder 3.20.0-dev2, at includes/widgets/image.php

867 lines 18.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Elementor;
3
4 if ( ! defined( 'ABSPATH' ) ) {
5 exit; // Exit if accessed directly.
6 }
7
8 use Elementor\Core\Kits\Documents\Tabs\Global_Colors;
9 use Elementor\Core\Kits\Documents\Tabs\Global_Typography;
10
11 /**
12 * Elementor image widget.
13 *
14 * Elementor widget that displays an image into the page.
15 *
16 * @since 1.0.0
17 */
18 class Widget_Image extends Widget_Base {
19
20 /**
21 * Get widget name.
22 *
23 * Retrieve image widget name.
24 *
25 * @since 1.0.0
26 * @access public
27 *
28 * @return string Widget name.
29 */
30 public function get_name() {
31 return 'image';
32 }
33
34 /**
35 * Get widget title.
36 *
37 * Retrieve image widget title.
38 *
39 * @since 1.0.0
40 * @access public
41 *
42 * @return string Widget title.
43 */
44 public function get_title() {
45 return esc_html__( 'Image', 'elementor' );
46 }
47
48 /**
49 * Get widget icon.
50 *
51 * Retrieve image widget icon.
52 *
53 * @since 1.0.0
54 * @access public
55 *
56 * @return string Widget icon.
57 */
58 public function get_icon() {
59 return 'eicon-image';
60 }
61
62 /**
63 * Get widget categories.
64 *
65 * Retrieve the list of categories the image widget belongs to.
66 *
67 * Used to determine where to display the widget in the editor.
68 *
69 * @since 2.0.0
70 * @access public
71 *
72 * @return array Widget categories.
73 */
74 public function get_categories() {
75 return [ 'basic' ];
76 }
77
78 /**
79 * Get widget keywords.
80 *
81 * Retrieve the list of keywords the widget belongs to.
82 *
83 * @since 2.1.0
84 * @access public
85 *
86 * @return array Widget keywords.
87 */
88 public function get_keywords() {
89 return [ 'image', 'photo', 'visual' ];
90 }
91
92 /**
93 * Register image widget controls.
94 *
95 * Adds different input fields to allow the user to change and customize the widget settings.
96 *
97 * @since 3.1.0
98 * @access protected
99 */
100 protected function register_controls() {
101 $this->start_controls_section(
102 'section_image',
103 [
104 'label' => esc_html__( 'Image', 'elementor' ),
105 ]
106 );
107
108 $this->add_control(
109 'image',
110 [
111 'label' => esc_html__( 'Choose Image', 'elementor' ),
112 'type' => Controls_Manager::MEDIA,
113 'dynamic' => [
114 'active' => true,
115 ],
116 'default' => [
117 'url' => Utils::get_placeholder_image_src(),
118 ],
119 ]
120 );
121
122 $this->add_group_control(
123 Group_Control_Image_Size::get_type(),
124 [
125 'name' => 'image', // Usage: `{name}_size` and `{name}_custom_dimension`, in this case `image_size` and `image_custom_dimension`.
126 'default' => 'large',
127 'condition' => [
128 'image[url]!' => '',
129 ],
130 ]
131 );
132
133 $this->add_control(
134 'caption_source',
135 [
136 'label' => esc_html__( 'Caption', 'elementor' ),
137 'type' => Controls_Manager::SELECT,
138 'options' => [
139 'none' => esc_html__( 'None', 'elementor' ),
140 'attachment' => esc_html__( 'Attachment Caption', 'elementor' ),
141 'custom' => esc_html__( 'Custom Caption', 'elementor' ),
142 ],
143 'default' => 'none',
144 'condition' => [
145 'image[url]!' => '',
146 ],
147 ]
148 );
149
150 $this->add_control(
151 'caption',
152 [
153 'label' => esc_html__( 'Custom Caption', 'elementor' ),
154 'type' => Controls_Manager::TEXT,
155 'default' => '',
156 'placeholder' => esc_html__( 'Enter your image caption', 'elementor' ),
157 'condition' => [
158 'image[url]!' => '',
159 'caption_source' => 'custom',
160 ],
161 'dynamic' => [
162 'active' => true,
163 ],
164 ]
165 );
166
167 $this->add_control(
168 'link_to',
169 [
170 'label' => esc_html__( 'Link', 'elementor' ),
171 'type' => Controls_Manager::SELECT,
172 'default' => 'none',
173 'options' => [
174 'none' => esc_html__( 'None', 'elementor' ),
175 'file' => esc_html__( 'Media File', 'elementor' ),
176 'custom' => esc_html__( 'Custom URL', 'elementor' ),
177 ],
178 'condition' => [
179 'image[url]!' => '',
180 ],
181 ]
182 );
183
184 $this->add_control(
185 'link',
186 [
187 'label' => esc_html__( 'Link', 'elementor' ),
188 'type' => Controls_Manager::URL,
189 'dynamic' => [
190 'active' => true,
191 ],
192 'condition' => [
193 'image[url]!' => '',
194 'link_to' => 'custom',
195 ],
196 'show_label' => false,
197 ]
198 );
199
200 $this->add_control(
201 'open_lightbox',
202 [
203 'label' => esc_html__( 'Lightbox', 'elementor' ),
204 'type' => Controls_Manager::SELECT,
205 'description' => sprintf(
206 /* translators: 1: Link open tag, 2: Link close tag. */
207 esc_html__( 'Manage your site’s lightbox settings in the %1$sLightbox panel%2$s.', 'elementor' ),
208 '<a href="javascript: $e.run( \'panel/global/open\' ).then( () => $e.route( \'panel/global/settings-lightbox\' ) )">',
209 '</a>'
210 ),
211 'default' => 'default',
212 'options' => [
213 'default' => esc_html__( 'Default', 'elementor' ),
214 'yes' => esc_html__( 'Yes', 'elementor' ),
215 'no' => esc_html__( 'No', 'elementor' ),
216 ],
217 'condition' => [
218 'image[url]!' => '',
219 'link_to' => 'file',
220 ],
221 ]
222 );
223
224 $this->end_controls_section();
225
226 $this->start_controls_section(
227 'section_style_image',
228 [
229 'label' => esc_html__( 'Image', 'elementor' ),
230 'tab' => Controls_Manager::TAB_STYLE,
231 ]
232 );
233
234 $this->add_responsive_control(
235 'align',
236 [
237 'label' => esc_html__( 'Alignment', 'elementor' ),
238 'type' => Controls_Manager::CHOOSE,
239 'options' => [
240 'left' => [
241 'title' => esc_html__( 'Left', 'elementor' ),
242 'icon' => 'eicon-text-align-left',
243 ],
244 'center' => [
245 'title' => esc_html__( 'Center', 'elementor' ),
246 'icon' => 'eicon-text-align-center',
247 ],
248 'right' => [
249 'title' => esc_html__( 'Right', 'elementor' ),
250 'icon' => 'eicon-text-align-right',
251 ],
252 ],
253 'selectors' => [
254 '{{WRAPPER}}' => 'text-align: {{VALUE}};',
255 ],
256 ]
257 );
258
259 $this->add_responsive_control(
260 'width',
261 [
262 'label' => esc_html__( 'Width', 'elementor' ),
263 'type' => Controls_Manager::SLIDER,
264 'default' => [
265 'unit' => '%',
266 ],
267 'tablet_default' => [
268 'unit' => '%',
269 ],
270 'mobile_default' => [
271 'unit' => '%',
272 ],
273 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ],
274 'range' => [
275 '%' => [
276 'min' => 1,
277 'max' => 100,
278 ],
279 'px' => [
280 'min' => 1,
281 'max' => 1000,
282 ],
283 'vw' => [
284 'min' => 1,
285 'max' => 100,
286 ],
287 ],
288 'selectors' => [
289 '{{WRAPPER}} img' => 'width: {{SIZE}}{{UNIT}};',
290 ],
291 ]
292 );
293
294 $this->add_responsive_control(
295 'space',
296 [
297 'label' => esc_html__( 'Max Width', 'elementor' ),
298 'type' => Controls_Manager::SLIDER,
299 'default' => [
300 'unit' => '%',
301 ],
302 'tablet_default' => [
303 'unit' => '%',
304 ],
305 'mobile_default' => [
306 'unit' => '%',
307 ],
308 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ],
309 'range' => [
310 '%' => [
311 'min' => 1,
312 'max' => 100,
313 ],
314 'px' => [
315 'min' => 1,
316 'max' => 1000,
317 ],
318 'vw' => [
319 'min' => 1,
320 'max' => 100,
321 ],
322 ],
323 'selectors' => [
324 '{{WRAPPER}} img' => 'max-width: {{SIZE}}{{UNIT}};',
325 ],
326 ]
327 );
328
329 $this->add_responsive_control(
330 'height',
331 [
332 'label' => esc_html__( 'Height', 'elementor' ),
333 'type' => Controls_Manager::SLIDER,
334 'size_units' => [ 'px', '%', 'em', 'rem', 'vh', 'custom' ],
335 'range' => [
336 'px' => [
337 'min' => 1,
338 'max' => 500,
339 ],
340 'vh' => [
341 'min' => 1,
342 'max' => 100,
343 ],
344 ],
345 'selectors' => [
346 '{{WRAPPER}} img' => 'height: {{SIZE}}{{UNIT}};',
347 ],
348 ]
349 );
350
351 $this->add_responsive_control(
352 'object-fit',
353 [
354 'label' => esc_html__( 'Object Fit', 'elementor' ),
355 'type' => Controls_Manager::SELECT,
356 'condition' => [
357 'height[size]!' => '',
358 ],
359 'options' => [
360 '' => esc_html__( 'Default', 'elementor' ),
361 'fill' => esc_html__( 'Fill', 'elementor' ),
362 'cover' => esc_html__( 'Cover', 'elementor' ),
363 'contain' => esc_html__( 'Contain', 'elementor' ),
364 ],
365 'default' => '',
366 'selectors' => [
367 '{{WRAPPER}} img' => 'object-fit: {{VALUE}};',
368 ],
369 ]
370 );
371
372 $this->add_responsive_control(
373 'object-position',
374 [
375 'label' => esc_html__( 'Object Position', 'elementor' ),
376 'type' => Controls_Manager::SELECT,
377 'options' => [
378 'center center' => esc_html__( 'Center Center', 'elementor' ),
379 'center left' => esc_html__( 'Center Left', 'elementor' ),
380 'center right' => esc_html__( 'Center Right', 'elementor' ),
381 'top center' => esc_html__( 'Top Center', 'elementor' ),
382 'top left' => esc_html__( 'Top Left', 'elementor' ),
383 'top right' => esc_html__( 'Top Right', 'elementor' ),
384 'bottom center' => esc_html__( 'Bottom Center', 'elementor' ),
385 'bottom left' => esc_html__( 'Bottom Left', 'elementor' ),
386 'bottom right' => esc_html__( 'Bottom Right', 'elementor' ),
387 ],
388 'default' => 'center center',
389 'selectors' => [
390 '{{WRAPPER}} img' => 'object-position: {{VALUE}};',
391 ],
392 'condition' => [
393 'height[size]!' => '',
394 'object-fit' => 'cover',
395 ],
396 ]
397 );
398
399 $this->add_control(
400 'separator_panel_style',
401 [
402 'type' => Controls_Manager::DIVIDER,
403 'style' => 'thick',
404 ]
405 );
406
407 $this->start_controls_tabs( 'image_effects' );
408
409 $this->start_controls_tab( 'normal',
410 [
411 'label' => esc_html__( 'Normal', 'elementor' ),
412 ]
413 );
414
415 $this->add_control(
416 'opacity',
417 [
418 'label' => esc_html__( 'Opacity', 'elementor' ),
419 'type' => Controls_Manager::SLIDER,
420 'range' => [
421 'px' => [
422 'max' => 1,
423 'min' => 0.10,
424 'step' => 0.01,
425 ],
426 ],
427 'selectors' => [
428 '{{WRAPPER}} img' => 'opacity: {{SIZE}};',
429 ],
430 ]
431 );
432
433 $this->add_group_control(
434 Group_Control_Css_Filter::get_type(),
435 [
436 'name' => 'css_filters',
437 'selector' => '{{WRAPPER}} img',
438 ]
439 );
440
441 $this->end_controls_tab();
442
443 $this->start_controls_tab( 'hover',
444 [
445 'label' => esc_html__( 'Hover', 'elementor' ),
446 ]
447 );
448
449 $this->add_control(
450 'opacity_hover',
451 [
452 'label' => esc_html__( 'Opacity', 'elementor' ),
453 'type' => Controls_Manager::SLIDER,
454 'range' => [
455 'px' => [
456 'max' => 1,
457 'min' => 0.10,
458 'step' => 0.01,
459 ],
460 ],
461 'selectors' => [
462 '{{WRAPPER}}:hover img' => 'opacity: {{SIZE}};',
463 ],
464 ]
465 );
466
467 $this->add_group_control(
468 Group_Control_Css_Filter::get_type(),
469 [
470 'name' => 'css_filters_hover',
471 'selector' => '{{WRAPPER}}:hover img',
472 ]
473 );
474
475 $this->add_control(
476 'background_hover_transition',
477 [
478 'label' => esc_html__( 'Transition Duration', 'elementor' ) . ' (s)',
479 'type' => Controls_Manager::SLIDER,
480 'range' => [
481 'px' => [
482 'min' => 0,
483 'max' => 3,
484 'step' => 0.1,
485 ],
486 ],
487 'selectors' => [
488 '{{WRAPPER}} img' => 'transition-duration: {{SIZE}}s',
489 ],
490 ]
491 );
492
493 $this->add_control(
494 'hover_animation',
495 [
496 'label' => esc_html__( 'Hover Animation', 'elementor' ),
497 'type' => Controls_Manager::HOVER_ANIMATION,
498 ]
499 );
500
501 $this->end_controls_tab();
502
503 $this->end_controls_tabs();
504
505 $this->add_group_control(
506 Group_Control_Border::get_type(),
507 [
508 'name' => 'image_border',
509 'selector' => '{{WRAPPER}} img',
510 'separator' => 'before',
511 ]
512 );
513
514 $this->add_responsive_control(
515 'image_border_radius',
516 [
517 'label' => esc_html__( 'Border Radius', 'elementor' ),
518 'type' => Controls_Manager::DIMENSIONS,
519 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ],
520 'selectors' => [
521 '{{WRAPPER}} img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
522 ],
523 ]
524 );
525
526 $this->add_group_control(
527 Group_Control_Box_Shadow::get_type(),
528 [
529 'name' => 'image_box_shadow',
530 'exclude' => [
531 'box_shadow_position',
532 ],
533 'selector' => '{{WRAPPER}} img',
534 ]
535 );
536
537 $this->end_controls_section();
538
539 $this->start_controls_section(
540 'section_style_caption',
541 [
542 'label' => esc_html__( 'Caption', 'elementor' ),
543 'tab' => Controls_Manager::TAB_STYLE,
544 'condition' => [
545 'image[url]!' => '',
546 'caption_source!' => 'none',
547 ],
548 ]
549 );
550
551 $this->add_responsive_control(
552 'caption_align',
553 [
554 'label' => esc_html__( 'Alignment', 'elementor' ),
555 'type' => Controls_Manager::CHOOSE,
556 'options' => [
557 'left' => [
558 'title' => esc_html__( 'Left', 'elementor' ),
559 'icon' => 'eicon-text-align-left',
560 ],
561 'center' => [
562 'title' => esc_html__( 'Center', 'elementor' ),
563 'icon' => 'eicon-text-align-center',
564 ],
565 'right' => [
566 'title' => esc_html__( 'Right', 'elementor' ),
567 'icon' => 'eicon-text-align-right',
568 ],
569 'justify' => [
570 'title' => esc_html__( 'Justified', 'elementor' ),
571 'icon' => 'eicon-text-align-justify',
572 ],
573 ],
574 'default' => '',
575 'selectors' => [
576 '{{WRAPPER}} .widget-image-caption' => 'text-align: {{VALUE}};',
577 ],
578 ]
579 );
580
581 $this->add_control(
582 'text_color',
583 [
584 'label' => esc_html__( 'Text Color', 'elementor' ),
585 'type' => Controls_Manager::COLOR,
586 'default' => '',
587 'selectors' => [
588 '{{WRAPPER}} .widget-image-caption' => 'color: {{VALUE}};',
589 ],
590 'global' => [
591 'default' => Global_Colors::COLOR_TEXT,
592 ],
593 ]
594 );
595
596 $this->add_control(
597 'caption_background_color',
598 [
599 'label' => esc_html__( 'Background Color', 'elementor' ),
600 'type' => Controls_Manager::COLOR,
601 'selectors' => [
602 '{{WRAPPER}} .widget-image-caption' => 'background-color: {{VALUE}};',
603 ],
604 ]
605 );
606
607 $this->add_group_control(
608 Group_Control_Typography::get_type(),
609 [
610 'name' => 'caption_typography',
611 'selector' => '{{WRAPPER}} .widget-image-caption',
612 'global' => [
613 'default' => Global_Typography::TYPOGRAPHY_TEXT,
614 ],
615 ]
616 );
617
618 $this->add_group_control(
619 Group_Control_Text_Shadow::get_type(),
620 [
621 'name' => 'caption_text_shadow',
622 'selector' => '{{WRAPPER}} .widget-image-caption',
623 ]
624 );
625
626 $this->add_responsive_control(
627 'caption_space',
628 [
629 'label' => esc_html__( 'Spacing', 'elementor' ),
630 'type' => Controls_Manager::SLIDER,
631 'size_units' => [ 'px', 'em', 'rem', 'custom' ],
632 'range' => [
633 'px' => [
634 'max' => 100,
635 ],
636 'em' => [
637 'min' => 0,
638 'max' => 10,
639 ],
640 'rem' => [
641 'min' => 0,
642 'max' => 10,
643 ],
644 ],
645 'selectors' => [
646 '{{WRAPPER}} .widget-image-caption' => 'margin-top: {{SIZE}}{{UNIT}};',
647 ],
648 ]
649 );
650
651 $this->end_controls_section();
652 }
653
654 /**
655 * Check if the current widget has caption
656 *
657 * @access private
658 * @since 2.3.0
659 *
660 * @param array $settings
661 *
662 * @return boolean
663 */
664 private function has_caption( $settings ) {
665 return ( ! empty( $settings['caption_source'] ) && 'none' !== $settings['caption_source'] );
666 }
667
668 /**
669 * Get the caption for current widget.
670 *
671 * @access private
672 * @since 2.3.0
673 * @param $settings
674 *
675 * @return string
676 */
677 private function get_caption( $settings ) {
678 $caption = '';
679 if ( ! empty( $settings['caption_source'] ) ) {
680 switch ( $settings['caption_source'] ) {
681 case 'attachment':
682 $caption = wp_get_attachment_caption( $settings['image']['id'] );
683 break;
684 case 'custom':
685 $caption = ! Utils::is_empty( $settings['caption'] ) ? $settings['caption'] : '';
686 }
687 }
688 return $caption;
689 }
690
691 /**
692 * Render image widget output on the frontend.
693 *
694 * Written in PHP and used to generate the final HTML.
695 *
696 * @since 1.0.0
697 * @access protected
698 */
699 protected function render() {
700 $settings = $this->get_settings_for_display();
701
702 if ( empty( $settings['image']['url'] ) ) {
703 return;
704 }
705
706 $has_caption = $this->has_caption( $settings );
707
708 $link = $this->get_link_url( $settings );
709
710 if ( $link ) {
711 $this->add_link_attributes( 'link', $link );
712
713 if ( Plugin::$instance->editor->is_edit_mode() ) {
714 $this->add_render_attribute( 'link', [
715 'class' => 'elementor-clickable',
716 ] );
717 }
718
719 if ( 'custom' !== $settings['link_to'] ) {
720 $this->add_lightbox_data_attributes( 'link', $settings['image']['id'], $settings['open_lightbox'] );
721 }
722 } ?>
723 <?php if ( $has_caption ) : ?>
724 <figure class="wp-caption">
725 <?php endif; ?>
726 <?php if ( $link ) : ?>
727 <a <?php $this->print_render_attribute_string( 'link' ); ?>>
728 <?php endif; ?>
729 <?php Group_Control_Image_Size::print_attachment_image_html( $settings ); ?>
730 <?php if ( $link ) : ?>
731 </a>
732 <?php endif; ?>
733 <?php if ( $has_caption ) : ?>
734 <figcaption class="widget-image-caption wp-caption-text"><?php
735 echo wp_kses_post( $this->get_caption( $settings ) );
736 ?></figcaption>
737 <?php endif; ?>
738 <?php if ( $has_caption ) : ?>
739 </figure>
740 <?php endif; ?>
741 <?php
742 }
743
744 /**
745 * Render image widget output in the editor.
746 *
747 * Written as a Backbone JavaScript template and used to generate the live preview.
748 *
749 * @since 2.9.0
750 * @access protected
751 */
752 protected function content_template() {
753 ?>
754 <# if ( settings.image.url ) {
755 var image = {
756 id: settings.image.id,
757 url: settings.image.url,
758 size: settings.image_size,
759 dimension: settings.image_custom_dimension,
760 model: view.getEditModel()
761 };
762
763 var image_url = elementor.imagesManager.getImageUrl( image );
764
765 if ( ! image_url ) {
766 return;
767 }
768
769 var hasCaption = function() {
770 if( ! settings.caption_source || 'none' === settings.caption_source ) {
771 return false;
772 }
773 return true;
774 }
775
776 var ensureAttachmentData = function( id ) {
777 if ( 'undefined' === typeof wp.media.attachment( id ).get( 'caption' ) ) {
778 wp.media.attachment( id ).fetch().then( function( data ) {
779 view.render();
780 } );
781 }
782 }
783
784 var getAttachmentCaption = function( id ) {
785 if ( ! id ) {
786 return '';
787 }
788 ensureAttachmentData( id );
789 return wp.media.attachment( id ).get( 'caption' );
790 }
791
792 var getCaption = function() {
793 if ( ! hasCaption() ) {
794 return '';
795 }
796 return 'custom' === settings.caption_source ? settings.caption : getAttachmentCaption( settings.image.id );
797 }
798
799 var link_url;
800
801 if ( 'custom' === settings.link_to ) {
802 link_url = settings.link.url;
803 }
804
805 if ( 'file' === settings.link_to ) {
806 link_url = settings.image.url;
807 }
808
809 var imgClass = '';
810
811 if ( '' !== settings.hover_animation ) {
812 imgClass = 'elementor-animation-' + settings.hover_animation;
813 }
814
815 if ( hasCaption() ) {
816 #><figure class="wp-caption"><#
817 }
818
819 if ( link_url ) {
820 #><a class="elementor-clickable" data-elementor-open-lightbox="{{ settings.open_lightbox }}" href="{{ link_url }}"><#
821 }
822 #><img src="{{ image_url }}" class="{{ imgClass }}" /><#
823
824 if ( link_url ) {
825 #></a><#
826 }
827
828 if ( hasCaption() ) {
829 #><figcaption class="widget-image-caption wp-caption-text">{{{ getCaption() }}}</figcaption><#
830 }
831
832 if ( hasCaption() ) {
833 #></figure><#
834 }
835 } #>
836 <?php
837 }
838
839 /**
840 * Retrieve image widget link URL.
841 *
842 * @since 3.11.0
843 * @access protected
844 *
845 * @param array $settings
846 *
847 * @return array|string|false An array/string containing the link URL, or false if no link.
848 */
849 protected function get_link_url( $settings ) {
850 if ( 'none' === $settings['link_to'] ) {
851 return false;
852 }
853
854 if ( 'custom' === $settings['link_to'] ) {
855 if ( empty( $settings['link']['url'] ) ) {
856 return false;
857 }
858
859 return $settings['link'];
860 }
861
862 return [
863 'url' => $settings['image']['url'],
864 ];
865 }
866 }
867