' . $link_tag . '';
if ( $link ) {
$slide_html .= '';
}
$slide_html .= '
';
$slides[] = $slide_html;
}
if ( empty( $slides ) ) {
return;
}
$this->add_render_attribute( [
'carousel' => [
'class' => 'elementor-image-carousel swiper-wrapper',
],
'carousel-wrapper' => [
'class' => 'elementor-image-carousel-wrapper swiper-container',
'dir' => $settings['direction'],
],
] );
$show_dots = ( in_array( $settings['navigation'], [ 'dots', 'both' ] ) );
$show_arrows = ( in_array( $settings['navigation'], [ 'arrows', 'both' ] ) );
if ( 'yes' === $settings['image_stretch'] ) {
$this->add_render_attribute( 'carousel', 'class', 'swiper-image-stretch' );
}
$slides_count = count( $settings['carousel'] );
?>
print_render_attribute_string( 'carousel-wrapper' ); ?>>
print_render_attribute_string( 'carousel' ); ?>>
wp_get_attachment_url( $attachment['id'] ),
];
}
/**
* Retrieve image carousel caption.
*
* @since 1.2.0
* @access private
*
* @param array $attachment
*
* @return string The caption of the image.
*/
private function get_image_caption( $attachment ) {
$caption_type = $this->get_settings_for_display( 'caption_type' );
if ( empty( $caption_type ) ) {
return '';
}
$attachment_post = get_post( $attachment['id'] );
if ( 'caption' === $caption_type ) {
return $attachment_post->post_excerpt;
}
if ( 'title' === $caption_type ) {
return $attachment_post->post_title;
}
return $attachment_post->post_content;
}
}