Widget_Image_Gallery::render()
Render image gallery widget output on the frontend.
Description
Written in PHP and used to generate the final HTML.
Changelog
Version | Description |
---|---|
1.0.0 | Introduced. |
Source
includes/widgets/image-gallery.php
if ( $settings['gallery_columns'] ) { $this->add_render_attribute( 'shortcode', 'columns', $settings['gallery_columns'] ); } if ( $settings['gallery_link'] ) { $this->add_render_attribute( 'shortcode', 'link', $settings['gallery_link'] ); } if ( ! empty( $settings['gallery_rand'] ) ) { $this->add_render_attribute( 'shortcode', 'orderby', $settings['gallery_rand'] ); } ?> <div class="elementor-image-gallery"> <?php $this->add_render_attribute( 'link', [ 'data-elementor-open-lightbox' => $settings['open_lightbox'], 'data-elementor-lightbox-slideshow' => $this->get_id(), ] ); if ( Plugin::$instance->editor->is_edit_mode() ) { $this->add_render_attribute( 'link', [ 'class' => 'elementor-clickable', ] ); } add_filter( 'wp_get_attachment_link', [ $this, 'add_lightbox_data_to_image_link' ] ); echo do_shortcode( '' ); remove_filter( 'wp_get_attachment_link', [ $this, 'add_lightbox_data_to_image_link' ] ); ?> </div> <?php } }