File: /var/www/zaklada/wp-content/themes/zaklada/sbi/item.php
<?php
/**
* Smash Balloon Instagram Feed Item Template
* Adds an image, link, and other data for each post in the feed
*
* @version 2.2 Instagram Feed by Smash Balloon
*
*/
// Don't load directly
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
$classes = SB_Instagram_Display_Elements::get_item_classes( $settings, $offset );
$post_id = SB_Instagram_Parse::get_post_id( $post );
$timestamp = SB_Instagram_Parse::get_timestamp( $post );
$media_type = SB_Instagram_Parse::get_media_type( $post );
$permalink = SB_Instagram_Parse::get_permalink( $post );
$maybe_carousel_icon = $media_type === 'carousel' ? SB_Instagram_Display_Elements::get_icon( 'carousel', $icon_type ) : '';
$maybe_video_icon = $media_type === 'video' ? SB_Instagram_Display_Elements::get_icon( 'video', $icon_type ) : '';
$media_url = SB_Instagram_Display_Elements::get_optimum_media_url( $post, $settings, $resized_images );
$media_full_res = SB_Instagram_Parse::get_media_url( $post );
$sbi_photo_style_element = SB_Instagram_Display_Elements::get_sbi_photo_style_element( $post, $settings ); // has already been escaped
$media_all_sizes_json = SB_Instagram_Parse::get_media_src_set( $post, $resized_images );
/**
* Text that appears in the "alt" attribute for this image
*
* @param string $img_alt full caption for post
* @param array $post api data for the post
*
* @since 2.1.5
*/
$img_alt = SB_Instagram_Parse::get_caption( $post, sprintf( __( 'Instagram post %s', 'instagram-feed' ), $post_id ) );
$img_alt = apply_filters( 'sbi_img_alt', $img_alt, $post );
/**
* Text that appears in the visually hidden screen reader element
*
* @param string $img_screenreader first 50 characters for post
* @param array $post api data for the post
*
* @since 2.1.5
*/
$img_screenreader = substr( SB_Instagram_Parse::get_caption( $post, sprintf( __( 'Instagram post %s', 'instagram-feed' ), $post_id ) ), 0, 50 );
$img_screenreader = apply_filters( 'sbi_img_screenreader', $img_screenreader, $post );
?>
<a class="sbi_item instagram-feed__box <?php echo esc_attr( $classes ); ?>" id="sbi_<?php echo esc_html( $post_id ); ?>" href="<?php echo esc_url( $permalink ); ?>" target="_blank" rel="noopener nofollow" data-date="<?php echo esc_html( $timestamp ); ?>">
<span class="sbi_photo lazyload" data-full-res="<?php echo esc_url( $media_full_res ); ?>" data-img-src-set="<?php echo esc_attr( sbi_json_encode( $media_all_sizes_json ) ); ?>"<?php echo $sbi_photo_style_element; ?> >
<img src="<?php echo esc_url( $media_url ); ?>" alt="<?php echo esc_attr( $img_alt ); ?>"">
</span>
</a>