print_render_attribute_string( 'gallery_container' ); ?>>
$tags ) :
$unique_index = $id; //$gallery_index . '_' . $index;
$image_src = wp_get_attachment_image_src( $id, $thumbnail_size );
if ( ! $image_src ) {
continue;
}
$attachment = get_post( $id );
$image_data = [
'alt' => get_post_meta( $attachment->ID, '_wp_attachment_image_alt', true ),
'media' => wp_get_attachment_image_src( $id, 'full' )['0'],
'src' => $image_src['0'],
'width' => $image_src['1'],
'height' => $image_src['2'],
'caption' => $attachment->post_excerpt,
'description' => $attachment->post_content,
'title' => $attachment->post_title,
];
$this->add_render_attribute( 'gallery_item_' . $unique_index, [
'class' => [
'e-gallery-item',
'elementor-gallery-item',
],
] );
if ( $has_animation ) {
$this->add_render_attribute( 'gallery_item_' . $unique_index, [ 'class' => 'elementor-animated-content' ] );
}
if ( $is_multiple ) {
$this->add_render_attribute( 'gallery_item_' . $unique_index, [ 'data-e-gallery-tags' => implode( ',', $tags ) ] );
}
if ( $has_title && 'div' === $gallery_item_tag ) {
$this->add_render_attribute( 'gallery_item_' . $unique_index, [ 'tabindex' => '0' ] );
}
if ( 'a' === $gallery_item_tag ) {
if ( 'file' === $settings['link_to'] ) {
$href = $image_data['media'];
$this->add_render_attribute( 'gallery_item_' . $unique_index, [
'href' => esc_url( $href ),
] );
if ( Plugin::elementor()->editor->is_edit_mode() ) {
$this->add_render_attribute( 'gallery_item_' . $unique_index, 'class', 'elementor-clickable' );
}
$this->add_lightbox_data_attributes( 'gallery_item_' . $unique_index, $id, $settings['open_lightbox'], $this->get_id() );
} elseif ( 'custom' === $settings['link_to'] ) {
$this->add_link_attributes( 'gallery_item_' . $unique_index, $settings['url'] );
}
}
$this->add_render_attribute( 'gallery_item_image_' . $unique_index,
[
'class' => [
'e-gallery-image',
'elementor-gallery-item__image',
],
'data-thumbnail' => $image_data['src'],
'data-width' => $image_data['width'],
'data-height' => $image_data['height'],
'aria-label' => $image_data['alt'],
'role' => 'img',
]
);?>
< print_render_attribute_string( 'gallery_item_' . $unique_index ); ?>>
print_render_attribute_string( 'gallery_item_image_' . $unique_index ); ?> >
print_render_attribute_string( 'gallery_item_background_overlay' ); ?>>
print_render_attribute_string( 'gallery_item_content' ); ?>>
print_render_attribute_string( 'gallery_item_title' ); ?>>
print_render_attribute_string( 'gallery_item_description' ); ?>>
>