protected function render()
{
$settings = $this->get_settings();
if (!$settings['wp_gallery']) {
return;
}
$ids = wp_list_pluck($settings['wp_gallery'], 'id');
$this->add_render_attribute('shortcode', 'ids', implode(',', $ids));
$this->add_render_attribute('shortcode', 'size', $settings['thumbnail_size']);
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
echo do_shortcode('[gallery ' . $this->get_render_attribute_string('shortcode') . ']');
?>
</div>
<?php
}