This commit is contained in:
2026-04-26 23:47:49 +02:00
parent 1b95f03d1e
commit b073e009d8
5288 changed files with 1112699 additions and 55536 deletions

View File

@@ -0,0 +1,8 @@
<?php
?>
<div class="sby_cta_items_wraps sby_cta_wrap">
<div class="sby_cta_inner_wrap">
</div>
</div>

View File

@@ -0,0 +1,94 @@
<?php
use SmashBalloon\YouTubeFeed\SBY_Display_Elements;
use SmashBalloon\YouTubeFeed\SBY_Parse;
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
$feed_styles = SBY_Display_Elements::get_feed_style( $settings );
$cols_setting = SBY_Display_Elements::get_cols( $settings );
$mobile_cols_setting = SBY_Display_Elements::get_cols_mobile( $settings );
$items_wrap_classes = $settings['infoposition'] === 'side' ? ' sby_info_side' : '';
$items_wrap_style_attr = SBY_Display_Elements::get_style_att( 'items_wrap', $settings );
$feed_classes = SBY_Display_Elements::get_feed_container_css_classes( $settings, $additional_classes );
$sby_main_atts = SBY_Display_Elements::get_feed_container_main_attributes( $settings );
if ( $header_data ) {
$subscriber_count = SBY_Parse::get_subscriber_count( $header_data );
$subscriber_count_with_text = SBY_Display_Elements::escaped_formatted_count_string( $subscriber_count, 'subscribers' );
}
$gallery_player_attr = SBY_Display_Elements::get_element_attribute( 'show_gallery_player', $settings );
$num_setting = $settings['num'];
$nummobile_setting = $settings['nummobile'];
$data_channel_header_colors = array(
'channelName' => !empty($settings['subscribebtnprimarycolor']) ? $settings['subscribebtnprimarycolor'] : '',
'subscribeCount' => !empty($settings['subscribebtnsecondarycolor']) ? $settings['subscribebtnsecondarycolor'] : '',
'buttonBackground' => !empty($settings['subscribelinkcolorbg']) ? $settings['subscribelinkcolorbg'] : '',
'buttonText' => !empty($settings['subscribebtntextcolor']) ? $settings['subscribebtntextcolor'] : '',
);
if ( $settings['showheader'] && ! empty( $posts ) && $settings['headeroutside'] ) {
include sby_get_feed_template_part( 'header', $settings );
}
?>
<div id="sb_youtube_<?php echo esc_attr( preg_replace( "/[^A-Za-z0-9 ]/", '', $feed_id ) ); ?>"
<?php echo $feed_classes; ?>
data-feedid="<?php echo esc_attr( $feed_id ); ?>"
data-shortcode-atts="<?php echo esc_attr( $shortcode_atts ); ?>"
data-cols="<?php echo esc_attr( $cols_setting ); ?>"
data-colsmobile="<?php echo esc_attr( $mobile_cols_setting ); ?>"
data-num="<?php echo esc_attr( $num_setting ); ?>"
data-nummobile="<?php echo esc_attr( $nummobile_setting ); ?>"
<?php $header_data ? printf( 'data-channel-subscribers="%s"', esc_attr( $subscriber_count_with_text ) ) : ''; ?>
data-subscribe-btn="<?php echo esc_attr( $settings['enablesubscriberlink'] ); ?>"
data-subscribe-btn-text="<?php echo esc_attr( SBY_Display_Elements::get_subscribe_btn_text( $settings ) ); ?>"
data_channel_header_colors ="<?php echo esc_attr(wp_json_encode($data_channel_header_colors)); ?>"
<?php echo $other_atts . $feed_styles; ?>
<?php echo $sby_main_atts ?>
>
<?php
if ( ( $settings['showheader'] && ! empty( $posts ) && !$settings['headeroutside'] ) || sby_doing_customizer( $settings ) ) {
SBY_Display_Elements::display_header( $header_data, $settings );
}
?>
<?php if ( $settings['layout'] === 'gallery' && isset( $posts[0] ) || sby_doing_customizer( $settings ) ) {
$placeholder_post = isset( $posts[0] ) ? $posts[0] : null;
$misc_data = $this->get_misc_data( $this->regular_feed_transient_name, $posts );
include sby_get_feed_template_part( 'player', $settings );
} ?>
<div class="sby_items_wrap<?php echo esc_attr($items_wrap_classes);?>"<?php echo $items_wrap_style_attr; ?>>
<?php
if ( ! in_array( 'ajaxPostLoad', $flags, true ) ) {
$settings['feed_id'] = $feed_id;
$this->posts_loop( $posts, $settings );
}
?>
</div>
<?php if ( isset( $posts[0] ) ) $this->maybe_add_live_html( $posts[0] ); ?>
<?php if ( ! empty( $posts ) ) { include sby_get_feed_template_part( 'footer', $settings ); } ?>
<?php if ( ( $settings['layout'] === 'grid' || $settings['layout'] === 'carousel' ) && sby_is_pro() ) {
include sby_get_feed_template_part( 'cta', $settings );
} ?>
<?php
/**
* Things to add before the closing "div" tag for the main feed element. Several
* features rely on this hook such as local images and some error messages
*
* @param object SBY_Feed
* @param string $feed_id
*
* @since 1.0
*/
do_action( 'sby_before_feed_end', $this, $feed_id ); ?>
</div>
<?php do_action( 'sby_after_feed', $feed_id, $posts, $settings );?>

View File

@@ -0,0 +1,48 @@
<?php
// Don't load directly
use SmashBalloon\YouTubeFeed\SBY_Display_Elements;
use SmashBalloon\YouTubeFeed\SBY_Parse;
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
$subscribe_url = isset( $posts[0] ) ? SBY_Parse::get_channel_permalink( $posts[0] ) : '';
$sub_btn_style = SBY_Display_Elements::get_subscribe_styles( $settings ); // style="background: rgb();color: rgb();" already escaped
$sub_btn_classes = strpos( $sub_btn_style, 'background' ) !== false ? ' sby_custom' : '';
$show_subscribe_button = $settings['showsubscribe'];
$subscribe_button_text = $settings['subscribetext'];
$load_btn_style = SBY_Display_Elements::get_load_button_styles( $settings ); // style="background: rgb();color: rgb();" already escaped
$load_btn_classes = strpos( $load_btn_style, 'background' ) !== false ? ' sby_custom' : '';
$load_button_text = __( $settings['buttontext'], 'feeds-for-youtube' );
?>
<div class="sby_footer">
<?php if ( $use_pagination || sby_doing_customizer( $settings ) ) : ?>
<a class="sby_load_btn" href="javascript:void(0);" <?php echo $load_btn_style; ?> <?php echo SBY_Display_Elements::get_button_data_attributes( $settings ); ?>>
<span class="sby_btn_text" <?php echo SBY_Display_Elements::get_load_button_attribute( $settings ); ?>><?php echo esc_html( $load_button_text ); ?></span>
<span class="sby_loader sby_hidden" style="background-color: rgb(255, 255, 255);"></span>
</a>
<?php endif; ?>
<?php if ( ($first_username && $show_subscribe_button) || sby_doing_customizer( $settings ) ) : ?>
<span
class="sby_follow_btn<?php echo esc_attr( $sub_btn_classes ); ?>"
<?php echo SBY_Display_Elements::get_subscribe_button_data_attributes( $settings ); ?>
>
<a
href="<?php echo esc_url( $subscribe_url ); ?>"
<?php echo $sub_btn_style; ?>
target="_blank"
rel="noopener"
>
<?php echo SBY_Display_Elements::get_icon( 'youtube', $icon_type ); ?>
<span <?php echo SBY_Display_Elements::get_subscribe_button_attribute( $settings ); ?> >
<?php echo esc_html( $subscribe_button_text ); ?>
</span>
</a>
</span>
<?php endif; ?>
</div>

View File

@@ -0,0 +1,21 @@
<?php
// Don't load directly
use SmashBalloon\YouTubeFeed\SBY_Display_Elements;
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
$header_style_attr = SBY_Display_Elements::get_style_att( 'items', $settings );
$header_text_color_style = SBY_Display_Elements::get_header_text_color_styles( $settings ); // style="color: #517fa4;" already escaped
$size_class = SBY_Display_Elements::get_header_size_class( $settings );
$header_display_condition = SBY_Display_Elements::get_header_display_condition( $settings );
$icon_type = $settings['font_method'];
?>
<div class="sb_youtube_header sby_header_type_generic <?php echo esc_attr( $size_class ); ?>"<?php echo $header_style_attr; ?> <?php echo $header_display_condition;?>>
<div class="sby_header_text sby_no_bio">
<h3 <?php echo $header_text_color_style; ?>>YouTube</h3>
</div>
<div class="sby_header_img">
<div class="sby_header_icon"><?php echo SBY_Display_Elements::get_icon( 'newlogo', $icon_type ); ?></div>
</div>
</div>

View File

@@ -0,0 +1,22 @@
<?php
/**
* Smash Balloon Custom YouTube Feed Pro Text Header Template
*
* @version 2.0 YouTube Feed Pro
* @author Smash Balloon
*/
use SmashBalloon\YouTubeFeed\SBY_Display_Elements;
// Don't load directly
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
$text_header_attrs = SBY_Display_Elements::get_text_header_attributes( $settings );
$text_header_display_condition = SBY_Display_Elements::get_text_header_display_condition( $settings );
$header_text_content = SBY_Display_Elements::get_text_header_content( $settings );
?>
<div <?php echo $text_header_display_condition; ?> class="sb_youtube_header sby-header-type-text" <?php echo $text_header_attrs ?>>
<span <?php echo $header_text_content; ?>><?php echo esc_html( $settings['customheadertext'] ); ?></span>
</div>

View File

@@ -0,0 +1,45 @@
<?php
// Don't load directly
use SmashBalloon\YouTubeFeed\Pro\SBY_Display_Elements_Pro;
use SmashBalloon\YouTubeFeed\SBY_Display_Elements;
use SmashBalloon\YouTubeFeed\SBY_Parse;
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
$avatar = SBY_Parse::get_avatar( $header_data, $settings );
$display_avatar = SBY_Display_Elements::get_display_avatar( $header_data, $settings );
$channel_title = SBY_Parse::get_channel_title( $header_data );
$channel_description = SBY_Parse::get_channel_description( $header_data );
$subscriber_count = SBY_Parse::get_subscriber_count( $header_data );
$should_show_subscriber = $settings['showsubscribers'] && $subscriber_count !== '';
$permalink = SBY_Parse::get_channel_permalink( $header_data );
$header_style_attr = SBY_Display_Elements::get_style_att( 'items', $settings );
$header_text_color_style = SBY_Display_Elements::get_header_text_color_styles( $settings ); // style="color: #517fa4;" already escaped
$size_class = SBY_Display_Elements::get_header_size_class( $settings );
$should_show_bio = $settings['showdescription'] && $channel_description !== '';
$bio_class = ! $should_show_bio ? ' sby_no_bio' : ' sby_has_bio';
$subscribers_class = ! $should_show_subscriber ? ' sby_no_sub' : ' sby_has_sub';
$header_text_attr = SBY_Display_Elements::get_header_text_attr( $settings );
$header_display_condition = SBY_Display_Elements::get_header_display_condition( $settings );
$icon_type = $settings['font_method'];
?>
<div class="sb_youtube_header <?php echo esc_attr( $size_class ); ?>"<?php echo $header_style_attr; ?> <?php echo $header_display_condition;?>>
<a href="<?php echo esc_url( $permalink ); ?>" target="_blank" rel="noopener" title="@<?php echo esc_attr( $channel_title ); ?>" class="sby_header_link" data-channel-description="<?php echo $settings['showdescription'] ? 'visible' : 'hidden'; ?>">
<div class="sby_header_text<?php echo esc_attr( $bio_class . $subscribers_class ); ?>" <?php echo $header_text_attr; ?>>
<h3 <?php echo $header_text_color_style; ?>><?php echo esc_html( $channel_title ); ?></h3>
<?php if ( $should_show_subscriber || sby_doing_customizer( $settings ) ) : ?>
<span class="sby_subscribers" <?php echo SBY_Display_Elements::get_subscribers_data_attributes( $settings ); ?>><?php echo SBY_Display_Elements::escaped_formatted_count_string($subscriber_count, 'subscribers' ); ?></span>
<?php endif; ?>
<?php if ( $should_show_bio || sby_doing_customizer( $settings ) ) : ?>
<p class="sby_bio" <?php echo SBY_Display_Elements::get_description_data_attributes( $settings ); ?> <?php echo $header_text_color_style; ?>><?php echo sby_esc_html_with_br( $channel_description ); ?></p>
<?php endif; ?>
</div>
<div class="sby_header_img" data-avatar-url="<?php echo esc_attr( $avatar ); ?>">
<div class="sby_header_img_hover"><?php echo SBY_Display_Elements::get_icon( 'newlogo', $icon_type ); ?></div>
<img src="<?php echo esc_url( $display_avatar ); ?>" alt="<?php echo esc_attr( $channel_title ); ?>" width="50" height="50">
</div>
</a>
</div>

View File

@@ -0,0 +1,145 @@
<?php
/**
* Info Template
* Adds channel information to the feed items
*
* @version 2.1 by Smash Balloon
*
*/
use SmashBalloon\YouTubeFeed\SBY_Parse;
use SmashBalloon\YouTubeFeed\Pro\SBY_Parse_Pro;
use SmashBalloon\YouTubeFeed\SBY_Display_Elements;
use SmashBalloon\YouTubeFeed\Pro\SBY_Display_Elements_Pro;
use SmashBalloon\YouTubeFeed\Pro\SBY_Comments_Pro;
$comments_check_class = '';
if ( $context === 'item' ) {
$channel_id = SBY_Parse::get_channel_id( $header_data );
$avatar = SBY_Parse::get_avatar($header_data, $settings );
$channel_title = SBY_Parse::get_channel_title( $header_data );
$subscriber_count = SBY_Parse_Pro::get_subscriber_count( $header_data );
$enable_comments = $settings['enablecomments'];
$live_streaming_timestamp = SBY_Parse::get_live_streaming_timestamp( $post );
$enable_comments_condition = $enable_comments && 0 === $live_streaming_timestamp;
$comments_check_class = $enable_comments_condition ? ' sby-comments-enabled' : '';
}
$show_subscribe_button = $settings['enablesubscriberlink'];
$subscribe_button_text = $settings['subscribetext'];
$subscribe_bar_attr = SBY_Display_Elements_Pro::get_list_type_subscribe_bar_attr( $settings );
$video_info_class = 'sby-video-info-bottom';
$youtube_icon = '<svg width="16" height="17" viewBox="0 0 16 17" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M6.66732 10.0634L10.1273 8.0634L6.66732 6.0634V10.0634ZM14.374 4.8434C14.4607 5.15673 14.5207 5.57673 14.5607 6.11006C14.6073 6.6434 14.6273 7.1034 14.6273 7.5034L14.6673 8.0634C14.6673 9.5234 14.5607 10.5967 14.374 11.2834C14.2073 11.8834 13.8207 12.2701 13.2207 12.4367C12.9073 12.5234 12.334 12.5834 11.454 12.6234C10.5873 12.6701 9.79398 12.6901 9.06065 12.6901L8.00065 12.7301C5.20732 12.7301 3.46732 12.6234 2.78065 12.4367C2.18065 12.2701 1.79398 11.8834 1.62732 11.2834C1.54065 10.9701 1.48065 10.5501 1.44065 10.0167C1.39398 9.4834 1.37398 9.0234 1.37398 8.6234L1.33398 8.0634C1.33398 6.6034 1.44065 5.53006 1.62732 4.8434C1.79398 4.2434 2.18065 3.85673 2.78065 3.69006C3.09398 3.6034 3.66732 3.5434 4.54732 3.5034C5.41398 3.45673 6.20732 3.43673 6.94065 3.43673L8.00065 3.39673C10.794 3.39673 12.534 3.5034 13.2207 3.69006C13.8207 3.85673 14.2073 4.2434 14.374 4.8434Z" fill="currentColor"/>
</svg>';
$meta_check = SBY_Display_Elements_Pro::should_show_element( 'meta', $context, $settings );
$title_check = SBY_Display_Elements_Pro::should_show_element( 'title', $context, $settings );
$live_stream_countdown_check = $live_broadcast_type !== 'none'&& SBY_Display_Elements_Pro::should_show_element( 'countdown', $context, $settings );
$stats_check = SBY_Display_Elements_Pro::should_show_element( 'stats', $context, $settings );
$description_check = SBY_Display_Elements_Pro::should_show_element( 'description', $context, $settings );
$video_info_check = $meta_check || $title_check || $live_stream_countdown_check || $stats_check || $description_check ? ' sby-video-info-rendered' : '';
?>
<div class="sby_info sby_info_<?php echo esc_attr( $context ); ?>">
<?php if ( ($context === 'item' && 0 === $post_index && $settings['layout'] === 'list') || sby_doing_customizer( $settings ) ) :
if ( $show_subscribe_button || sby_doing_customizer( $settings ) ) :
?>
<div class="sby-player-info" <?php echo $subscribe_bar_attr; ?>>
<div class="sby-channel-info-bar">
<?php if ( $header_data ) : ?>
<span class="sby-avatar">
<?php
printf(
'<img src="%s" referrerPolicy="no-referrer"/>',
esc_attr( $avatar )
);
?>
</span>
<span class="sby-channel-name"><?php echo esc_html( $channel_title ); ?></span>
<span class="sby-channel-subscriber-count">
<?php echo SBY_Display_Elements_Pro::escaped_formatted_count_string( $subscriber_count, '' ); ?>
</span>
<?php endif; ?>
<span class="sby-channel-subscribe-btn">
<?php
printf(
'<a href="%s" target="_blank" rel="noopener noreferrer">%s <span %s>%s</span></a>',
'http://www.youtube.com/channel/'. esc_attr( $channel_id ) .'?sub_confirmation=1&feature=subscribe-embed-click',
$youtube_icon,
SBY_Display_Elements::get_subscribe_button_attribute( $settings ),
esc_html( $subscribe_button_text )
);
?>
</span>
</div>
</div>
<?php endif; endif; ?>
<?php if( sby_doing_customizer( $settings ) ): ?>
<div class="<?php echo esc_attr($video_info_class); ?>" :class="$parent.valueIsEnabled( $parent.customizerFeedData.settings.enablecomments ) ? 'sby-comments-enabled' : '' ">
<?php else :
echo '<div class="'. esc_attr($video_info_class). ''. esc_attr($comments_check_class) . '">';
endif; ?>
<div class="sby-video-info">
<?php if ( $title_check ) : ?>
<p class="sby_video_title_wrap" <?php echo $video_title_attr; ?>>
<span class="sby_video_title"><?php echo sby_esc_html_with_br( $title ); ?></span>
</p>
<?php endif; ?>
<?php if ( $meta_check ) : ?>
<p class="sby_meta" <?php echo $sby_meta_color_styles; ?>>
<?php if ( SBY_Display_Elements_Pro::should_show_element( 'user', $context, $settings ) ) : ?>
<span class="sby_username_wrap" <?php echo $sby_meta_size_color_styles; echo $username_attr; ?>>
<span class="sby_username"><?php echo esc_html( $username ); ?></span>
</span>
<?php endif; ?>
<?php if ( SBY_Display_Elements_Pro::should_show_element( 'views', $context, $settings ) ) : ?>
<span class="sby_view_count_wrap" <?php echo $sby_meta_size_color_styles; echo $views_attr; ?>>
<span class="sby_view_count"><?php echo $views_count_string; ?></span>
</span>
<?php endif; ?>
<?php if ( SBY_Display_Elements_Pro::should_show_element( 'date', $context, $settings ) ) : ?>
<span class="sby_date_wrap" <?php echo $date_attr; ?>>
<span class="sby_date sby_live_broadcast_type_<?php echo esc_attr( $live_broadcast_type ); ?>"><?php echo $formatted_date_string; ?></span>
</span>
<?php endif; ?>
</p>
<?php endif; ?>
<?php if ( $live_stream_countdown_check ) : ?>
<p class="sby_ls_message_wrap" <?php echo $countdown_attr; ?>>
<span class="sby_ls_message"><?php echo $live_streaming_time_string; ?></span>
</p>
<?php endif; ?>
<?php if ( $context === 'item' && $stats_check ) : ?>
<p class="sby_stats" <?php echo $stats_attr; ?>>
<span class="sby_likes" <?php echo $sby_meta_size_color_styles; ?>>
<?php echo SBY_Display_Elements_Pro::get_icon( 'likes', $icon_type, $sby_meta_size_color_styles ); ?>
<span class="sby_like_count"><?php echo $likes_count; ?></span>
</span>
<span class="sby_comments" <?php echo $sby_meta_size_color_styles; ?>>
<?php echo SBY_Display_Elements_Pro::get_icon( 'comments', $icon_type, $sby_meta_size_color_styles ); ?>
<span class="sby_comment_count"><?php echo $comments_count; ?></span>
</span>
</p>
<?php endif; ?>
<?php if ( $context === 'item' && $description_check ) : ?>
<p class="sby_caption_wrap sby_item_caption_wrap" <?php echo $description_attr; ?>>
<span class="sby_caption" <?php echo $sby_info_styles; ?>><?php echo sby_esc_html_with_br( $caption ); ?></span><span class="sby_expand"> <a href="#"><span class="sby_more">...</span></a></span>
</p>
<?php endif; ?>
</div>
<?php if ( sby_is_pro() ) : ?>
<?php if ( ( $context === 'item' && $settings['layout'] === 'list') || sby_doing_customizer( $settings ) ) : ?>
<?php if ( $enable_comments_condition || sby_doing_customizer( $settings ) ) :?>
<?php echo SBY_Comments_Pro::comment_html($settings) ?>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
</div>
</div>

View File

@@ -0,0 +1,162 @@
<?php
/**
* Item Template
* Adds an image, link, and other data for each post in the feed
*
* @version 1.0 by Smash Balloon
*
*/
// Don't load directly
use SmashBalloon\YouTubeFeed\SBY_Display_Elements;
use SmashBalloon\YouTubeFeed\Pro\SBY_Display_Elements_Pro;
use SmashBalloon\YouTubeFeed\SBY_Parse;
use SmashBalloon\YouTubeFeed\Pro\SBY_Parse_Pro;
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
$context = 'item';
$classes = SBY_Display_Elements::get_item_classes( $settings, $offset );
$post_id = SBY_Parse::get_post_id( $post );
$timestamp = SBY_Parse::get_timestamp( $post );
$video_id = SBY_Parse::get_video_id( $post );
$channel_id = SBY_Parse::get_channel_id( $post );
$media_url = SBY_Display_Elements::get_optimum_media_url( $post, $settings );
$media_full_res = SBY_Parse::get_media_url( $post );
$media_all_sizes_json = SBY_Parse::get_media_src_set( $post );
$permalink = SBY_Parse::get_permalink( $post );
$img_alt = SBY_Parse::get_caption( $post, __( 'Image for post', 'feeds-for-youtube' ) . ' ' . $post_id );
$items_style_attr = SBY_Display_Elements::get_style_att( 'item', $settings );
$title = SBY_Parse::get_video_title( $post );
// Pro Elements
$caption = SBY_Parse::get_pro_caption( $post, '', $misc_data );
$avatar = SBY_Parse::get_avatar( $header_data, $settings );
$username = SBY_Parse::get_channel_title( $post, $misc_data );
$likes_count = SBY_Display_Elements::escaped_formatted_count_string( SBY_Parse::get_like_count( $post, $misc_data ), 'likes' );
$comments_count = SBY_Display_Elements::escaped_formatted_count_string( SBY_Parse::get_comment_count( $post, $misc_data ), 'comments' );
$comments_count_attr = SBY_Display_Elements::escaped_formatted_count_string( SBY_Parse::get_comment_count( $post, $misc_data ), 'comments', true );
$views_count_string = SBY_Display_Elements::escaped_formatted_count_string( SBY_Parse::get_view_count( $post, $misc_data ), 'views' );
$views_count_string_attr = SBY_Display_Elements::escaped_formatted_count_string( SBY_Parse::get_view_count( $post, $misc_data ), 'views', true );
$duration = SBY_Parse_Pro::get_video_duration( $post );
$live_broadcast_type = SBY_Parse::get_live_broadcast_content( $post ); // 'none', 'upcoming', 'live', 'completed'
$live_streaming_timestamp = SBY_Parse::get_live_streaming_timestamp( $post, $misc_data );
$live_streaming_time_string = SBY_Display_Elements::escaped_live_streaming_time_string( $post, $misc_data );
$formatted_date_string = $live_broadcast_type === 'none' ? SBY_Display_Elements::format_date( $timestamp, $settings ) : SBY_Display_Elements::format_date( $live_streaming_timestamp, $settings, true );
$sby_link_classes = SBY_Display_Elements::get_sby_link_classes( $settings ); // // ' sby_disable_lightbox'
// Pro Styles
$link_styles = SBY_Display_Elements::get_sby_link_styles( $settings ); // style="background: rgba(30,115,190,0.85)" already escaped
$hover_styles = SBY_Display_Elements::get_hover_styles( $settings ); // style="color: rgba(153,231,255,1)" already escaped
$sby_info_styles = SBY_Display_Elements::get_sby_info_styles( $settings ); // style="font-size: 13px;" already escaped
$sby_meta_color_styles = SBY_Display_Elements::get_sby_meta_color_styles( $settings ); // style="font-size: 13px;" already escaped
$sby_meta_size_color_styles = SBY_Display_Elements::get_sby_meta_size_color_styles( $settings ); // style="font-size: 13px;color: rgba(153,231,255,1)" already escaped
$additional_atts = apply_filters( 'sby_item_additional_data_atts', array(), $post, $misc_data );
$additional_atts_string = SBY_Display_Elements::escaped_data_att_string( $additional_atts );
// customizer only attributes
if(sby_doing_customizer($settings)) {
$media_url = SBY_Display_Elements::get_media_url( $settings, $media_url, $media_full_res );
}
$play_icon_attr = SBY_Display_Elements::get_element_attribute( 'icon', $settings );
$video_title_attr = SBY_Display_Elements::get_element_attribute( 'title', $settings );
$username_attr = SBY_Display_Elements::get_element_attribute( 'user', $settings );
$views_attr = SBY_Display_Elements::get_element_attribute( 'views', $settings );
$date_attr = SBY_Display_Elements::get_element_attribute( 'date', $settings );
$countdown_attr = SBY_Display_Elements::get_element_attribute( 'countdown', $settings );
$stats_attr = SBY_Display_Elements::get_element_attribute( 'stats', $settings );
$description_attr = SBY_Display_Elements::get_element_attribute( 'description', $settings );
$duration_attr = SBY_Display_Elements::get_element_attribute( 'duration', $settings );
$hover_video_title_attr = SBY_Display_Elements::get_element_attribute( 'hover_title', $settings );
$hover_video_user_attr = SBY_Display_Elements::get_element_attribute( 'hover_user', $settings );
$hover_video_countdown_attr = SBY_Display_Elements::get_element_attribute( 'hover_countdown', $settings );
$hover_video_description_attr = SBY_Display_Elements::get_element_attribute( 'hover_description', $settings );
$hover_date_attr = SBY_Display_Elements::get_element_attribute( 'hover_date', $settings );
$hover_video_views_attr = SBY_Display_Elements::get_element_attribute( 'hover_views', $settings );
$hover_video_stats_attr = SBY_Display_Elements::get_element_attribute( 'hover_stats', $settings );
?>
<div class="sby_item <?php echo esc_attr( $classes ); ?>" id="sby_<?php echo esc_html( $post_id ); ?>" data-date="<?php echo esc_html( $timestamp ); ?>" data-video-id="<?php echo esc_attr( $video_id ); ?>" data-video-title="<?php echo esc_attr( $title ); ?>"<?php echo $items_style_attr; ?> data-live-date="<?php echo esc_attr( $live_streaming_timestamp ); ?>" data-channel-id="<?php echo esc_attr( $channel_id ); ?>" <?php echo $additional_atts_string; ?>>
<div class="sby_inner_item">
<div class="sby_video_thumbnail_wrap sby_item_video_thumbnail_wrap">
<a class="sby_video_thumbnail sby_item_video_thumbnail" style="background-image:url(<?php echo esc_url( $media_url ); ?>)" href="<?php echo esc_url( $permalink ); ?>" target="_blank" rel="noopener" data-full-res="<?php echo esc_url( $media_full_res ); ?>" data-img-src-set="<?php echo esc_attr( wp_json_encode( $media_all_sizes_json ) ); ?>" data-video-id="<?php echo esc_attr( $video_id ); ?>" data-user="<?php echo esc_attr( $username ); ?>" data-url="<?php echo esc_attr( $permalink ); ?>" data-avatar="<?php echo esc_attr( $avatar ); ?>" data-title="<?php echo sby_esc_attr_with_br( $caption ); ?>" data-video-title="<?php echo sby_esc_attr_with_br( $title ); ?>" data-channel-id="<?php echo esc_attr( $channel_id ); ?>" data-views="<?php echo esc_attr($views_count_string_attr); ?>" data-published-date="<?php echo esc_attr($timestamp); ?>" data-formatted-published-date="<?php echo esc_attr($formatted_date_string); ?>" data-comment-count="<?php echo esc_attr($comments_count_attr); ?>">
<img src="<?php echo esc_url( $media_url ); ?>" alt="<?php echo esc_attr( $img_alt ); ?>">
<?php if ( SBY_Display_Elements_Pro::should_show_element( 'duration', $context, $settings ) ) : ?>
<span class="sby_duration_counter" <?php echo $duration_attr; ?>><?php echo esc_html( $duration ); ?></span>
<?php endif; ?>
<div class="sby_thumbnail_hover sby_item_video_thumbnail_hover">
<div class="sby_thumbnail_hover_inner">
<?php if ( SBY_Display_Elements::should_show_element( 'title', $context . '-hover', $settings ) ) : ?>
<span class="sby_video_title" <?php echo $hover_video_title_attr; ?>><?php echo esc_html( $title ); ?></span>
<?php endif; ?>
<?php if ( $live_broadcast_type !== 'none' && SBY_Display_Elements::should_show_element( 'countdown', $context . '-hover', $settings ) ) : ?>
<p class="sby_ls_message_wrap" <?php echo $hover_video_countdown_attr; ?>><span class="sby_ls_message"><?php echo $live_streaming_time_string; ?></span></p>
<?php endif; ?>
<?php if ( SBY_Display_Elements::should_show_element( 'meta', $context . '-hover', $settings ) ) : ?>
<p class="sby_meta" <?php echo $sby_meta_color_styles; ?>>
<?php if ( SBY_Display_Elements::should_show_element( 'user', $context . '-hover', $settings ) ) : ?>
<span class="sby_username" <?php echo $hover_video_user_attr; ?>><?php echo esc_html( $username ); ?></span>
<?php endif; ?>
<?php if ( SBY_Display_Elements::should_show_element( 'views', $context . '-hover', $settings ) ) : ?>
<span class="sby_view_count" <?php echo $hover_video_views_attr; ?>><?php echo $views_count_string; ?></span>
<?php endif; ?>
<?php if ( SBY_Display_Elements::should_show_element( 'date', $context . '-hover', $settings ) ) : ?>
<span class="sby_date sby_live_broadcast_type_<?php echo esc_attr( $live_broadcast_type ); ?>" <?php echo $hover_date_attr; ?>><?php echo $formatted_date_string; ?></span>
<?php endif; ?>
</p>
<?php endif; ?>
<?php if ( SBY_Display_Elements::should_show_element( 'description', $context . '-hover', $settings ) ) : ?>
<p class="sby_caption" <?php echo $sby_info_styles; echo $hover_video_description_attr; ?>><?php echo sby_esc_html_with_br( $caption ); ?></p>
<?php endif; ?>
<?php if ( SBY_Display_Elements::should_show_element( 'stats', $context . '-hover', $settings ) ) : ?>
<p class="sby_stats" <?php echo $sby_meta_color_styles; echo $hover_video_stats_attr; ?>>
<span class="sby_likes" <?php echo $sby_meta_size_color_styles; ?>>
<?php echo SBY_Display_Elements::get_icon( 'likes', $icon_type, $sby_meta_size_color_styles ); ?>
<span class="sby_like_count"><?php echo $likes_count; ?></span>
</span>
<span class="sby_comments" <?php echo $sby_meta_size_color_styles; ?>>
<?php echo SBY_Display_Elements::get_icon( 'comments', $icon_type, $sby_meta_size_color_styles ); ?>
<span class="sby_comment_count"><?php echo $comments_count; ?></span>
</span>
</p>
<?php endif; ?>
</div>
</div>
<span class="sby-screenreader"><?php echo sprintf( __( 'YouTube Video %s', 'feeds-for-youtube' ), $post_id ); ?></span>
<?php if ( SBY_Display_Elements::should_show_element( 'icon', $context, $settings ) ) : ?>
<div class="sby_play_btn" <?php echo $play_icon_attr; ?>>
<span class="sby_play_btn_bg"></span>
<?php echo SBY_Display_Elements::get_icon( 'play', 'svg' ); ?>
</div>
<?php endif; ?>
<span class="sby_loader sby_hidden" style="background-color: rgb(255, 255, 255);"></span>
</a>
<?php if ( $settings['layout'] === 'list') : ?>
<div class="sby_player_wrap">
<div id="sby_player_<?php echo esc_html( $video_id ); ?>"></div>
</div>
<?php include sby_get_feed_template_part( 'cta', $settings ); ?>
<?php endif; ?>
</div>
<?php
if ( sby_is_pro() ) {
include sby_get_feed_template_part( 'info', $settings );
}
?>
</div>
</div>

View File

@@ -0,0 +1,76 @@
<?php
use SmashBalloon\YouTubeFeed\SBY_Parse;
use SmashBalloon\YouTubeFeed\SBY_Display_Elements;
use SmashBalloon\YouTubeFeed\Pro\SBY_Comments_Pro;
$channel_id = SBY_Parse::get_channel_id( $placeholder_post );
$avatar = SBY_Parse::get_avatar($header_data, $settings );
$subscriber_count = SBY_Parse::get_subscriber_count( $header_data );
$channel_title = SBY_Parse::get_channel_title( $header_data );
$title = SBY_Parse::get_video_title( $placeholder_post );
$timestamp = SBY_Parse::get_timestamp( $placeholder_post );
$live_streaming_timestamp = SBY_Parse::get_live_streaming_timestamp( $placeholder_post);
$subscribe_button_text = $settings['subscribetext'];
$show_subscribe_button = $settings['enablesubscriberlink'];
$enable_comments = $settings['enablecomments'];
$enable_comments_condition = $enable_comments && 0 === $live_streaming_timestamp;
$comments_check_class = $enable_comments_condition ? ' sby-comments-enabled' : '';
$video_info_class = 'sby-video-header-info';
$live_broadcast_type = SBY_Parse::get_live_broadcast_content( $placeholder_post ); // 'none', 'upcoming', 'live', 'completed'
$formatted_date_string = $live_broadcast_type === 'none' ? SBY_Display_Elements::format_date( $timestamp, $settings ) : SBY_Display_Elements::format_date( $live_streaming_timestamp, $settings, true );
$youtube_icon = '<svg width="16" height="17" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M6.66732 10.0634L10.1273 8.0634L6.66732 6.0634V10.0634ZM14.374 4.8434C14.4607 5.15673 14.5207 5.57673 14.5607 6.11006C14.6073 6.6434 14.6273 7.1034 14.6273 7.5034L14.6673 8.0634C14.6673 9.5234 14.5607 10.5967 14.374 11.2834C14.2073 11.8834 13.8207 12.2701 13.2207 12.4367C12.9073 12.5234 12.334 12.5834 11.454 12.6234C10.5873 12.6701 9.79398 12.6901 9.06065 12.6901L8.00065 12.7301C5.20732 12.7301 3.46732 12.6234 2.78065 12.4367C2.18065 12.2701 1.79398 11.8834 1.62732 11.2834C1.54065 10.9701 1.48065 10.5501 1.44065 10.0167C1.39398 9.4834 1.37398 9.0234 1.37398 8.6234L1.33398 8.0634C1.33398 6.6034 1.44065 5.53006 1.62732 4.8434C1.79398 4.2434 2.18065 3.85673 2.78065 3.69006C3.09398 3.6034 3.66732 3.5434 4.54732 3.5034C5.41398 3.45673 6.20732 3.43673 6.94065 3.43673L8.00065 3.39673C10.794 3.39673 12.534 3.5034 13.2207 3.69006C13.8207 3.85673 14.2073 4.2434 14.374 4.8434Z" fill="currentColor"/>
</svg>';
?>
<div class="sby-player-info">
<?php if ( $show_subscribe_button || sby_doing_customizer( $settings ) ) : ?>
<div class="sby-channel-info-bar" <?php echo SBY_Display_Elements::get_subscribe_bar_link_data_attributes( $settings ); ?>>
<?php if ( $header_data ) : ?>
<span class="sby-avatar">
<?php
printf(
'<img src="%s" referrerPolicy="no-referrer"/>',
esc_attr( $avatar )
);
?>
</span>
<span class="sby-channel-name"><?php echo esc_html( $channel_title ); ?></span>
<span class="sby-channel-subscriber-count">
<?php echo SBY_Display_Elements::escaped_formatted_count_string( $subscriber_count, '' ); ?>
</span>
<?php endif; ?>
<span class="sby-channel-subscribe-btn">
<?php
printf(
'<a href="%s" target="_blank" rel="noopener noreferrer">%s <span %s>%s</span></a>',
'http://www.youtube.com/channel/'. esc_attr( $channel_id ) .'?sub_confirmation=1&feature=subscribe-embed-click',
$youtube_icon,
SBY_Display_Elements::get_subscribe_button_attribute( $settings ),
esc_html( $subscribe_button_text )
);
?>
</span>
</div>
<?php endif; ?>
<?php if( sby_doing_customizer( $settings ) ): ?>
<div class="<?php echo esc_attr($video_info_class); ?>" :class="$parent.valueIsEnabled( $parent.customizerFeedData.settings.enablecomments ) ? 'sby-comments-enabled' : '' ">
<?php else :
echo '<div class="'. esc_attr($video_info_class). ''. esc_attr($comments_check_class) . '">';
endif; ?>
<div class="sby-video-info-header">
<h5><?php echo esc_html( $title ); ?></h5>
<div class="sby-video-header-meta">
<span class="sby-channel-name"><?php echo esc_html( $channel_title ); ?></span>
<span class="sby-video-date"><?php echo esc_html( $formatted_date_string ); ?></span>
</div>
</div>
<?php if ( sby_is_pro() ) : ?>
<?php if ( $enable_comments_condition || sby_doing_customizer( $settings ) ) : ?>
<?php echo SBY_Comments_Pro::comment_html($settings) ?>
<?php endif; ?>
<?php endif; ?>
</div>
</div>

View File

@@ -0,0 +1,68 @@
<?php
use SmashBalloon\YouTubeFeed\Pro\SBY_Display_Elements_Pro;
use SmashBalloon\YouTubeFeed\Pro\SBY_Parse_Pro;
use SmashBalloon\YouTubeFeed\SBY_Display_Elements;
use SmashBalloon\YouTubeFeed\SBY_Parse;
$post_id = SBY_Parse::get_post_id( $placeholder_post );
$timestamp = SBY_Parse::get_timestamp( $placeholder_post );
$video_id = SBY_Parse::get_video_id( $placeholder_post );
$protocol = is_ssl() ? 'https' : 'http';
$media_url = SBY_Display_Elements::get_optimum_media_url( $placeholder_post, $settings );
$media_full_res = SBY_Parse::get_media_url( $placeholder_post );
$media_all_sizes_json = SBY_Parse::get_media_src_set( $placeholder_post );
$permalink = SBY_Parse::get_permalink( $placeholder_post );
$img_alt = SBY_Parse::get_caption( $placeholder_post, __( 'Image for post', 'feeds-for-youtube' ) . ' ' . $post_id );
$player_outer_wrap_style_attr = SBY_Display_Elements::get_style_att( 'player_outer_wrap', $settings );
$title = SBY_Parse::get_video_title( $placeholder_post );
$media_url = SBY_Display_Elements::get_media_url( $settings, $media_url, $media_full_res );
// Pro Elements
$caption = SBY_Parse::get_pro_caption( $placeholder_post, '', $misc_data );
$avatar = SBY_Parse::get_item_avatar( $placeholder_post, $settings['feed_avatars'] );
$username = SBY_Parse::get_channel_title( $placeholder_post, $misc_data );
$likes_count = SBY_Display_Elements::escaped_formatted_count_string( SBY_Parse::get_like_count( $placeholder_post, $misc_data ), 'likes' );
$comments_count = SBY_Display_Elements::escaped_formatted_count_string( SBY_Parse::get_comment_count( $placeholder_post, $misc_data ), 'comments' );
$views_count_string = SBY_Display_Elements::escaped_formatted_count_string( SBY_Parse::get_view_count( $placeholder_post, $misc_data ), 'views' );
$live_broadcast_type = SBY_Parse::get_live_broadcast_content( $placeholder_post ); // 'none', 'upcoming', 'live', 'completed'
$live_streaming_timestamp = SBY_Parse::get_live_streaming_timestamp( $placeholder_post, $misc_data );
$live_streaming_time_string = SBY_Display_Elements::escaped_live_streaming_time_string( $placeholder_post, $misc_data );
$formatted_date_string = $live_broadcast_type === 'none' ? SBY_Display_Elements::format_date( $timestamp, $settings ) : SBY_Display_Elements::format_date( $live_streaming_timestamp, $settings, true );
$sby_link_classes = SBY_Display_Elements::get_sby_link_classes( $settings ); // // ' sby_disable_lightbox'
$player_attributes = SBY_Display_Elements::get_player_attributes( $settings );
// Pro Styles
$link_styles = SBY_Display_Elements::get_sby_link_styles( $settings ); // style="background: rgba(30,115,190,0.85)" already escaped
$hover_styles = SBY_Display_Elements::get_hover_styles( $settings ); // style="color: rgba(153,231,255,1)" already escaped
$sby_info_styles = SBY_Display_Elements::get_sby_info_styles( $settings ); // style="font-size: 13px;" already escaped
$sby_meta_color_styles = SBY_Display_Elements::get_sby_meta_color_styles( $settings ); // style="font-size: 13px;" already escaped
$sby_meta_size_color_styles = SBY_Display_Elements::get_sby_meta_size_color_styles( $settings ); // style="font-size: 13px;color: rgba(153,231,255,1)" already escaped?>
<div id="sby_player_<?php echo esc_attr( $post_id ); ?>" class="sby_player_outer_wrap sby_player_item" <?php echo $player_outer_wrap_style_attr; echo $player_attributes; ?> >
<div class="sby_video_thumbnail_wrap">
<a class="sby_video_thumbnail sby_player_video_thumbnail" href="<?php echo esc_url( $permalink ); ?>" target="_blank" rel="noopener" data-full-res="<?php echo esc_url( $media_full_res ); ?>" data-img-src-set="<?php echo esc_attr( wp_json_encode( $media_all_sizes_json ) ); ?>" data-video-id="<?php echo esc_attr( $video_id ); ?>">
<span class="sby-screenreader"><?php echo sprintf( __( 'YouTube Video %s', 'feeds-for-youtube' ), $post_id ); ?></span>
<img src="<?php echo esc_url( $media_url ); ?>" alt="<?php echo esc_attr( $img_alt ); ?>">
<span class="sby_loader sby_hidden" style="background-color: rgb(255, 255, 255);"></span>
</a>
<?php if ( SBY_Display_Elements::should_show_element( 'icon', 'player', $settings ) ) : ?>
<div class="sby_play_btn">
<?php echo SBY_Display_Elements::get_icon( 'play', 'svg' ); ?>
<span class="sby_play_btn_bg"></span>
</div>
<?php endif; ?>
<div class="sby_player_wrap">
<div class="sby_player"></div>
</div>
<?php include sby_get_feed_template_part( 'cta', $settings ); ?>
</div>
<?php
$context = 'player';
include sby_get_feed_template_part( 'player-info', $settings );
?>
</div>

View File

@@ -0,0 +1,20 @@
<?php
$search_videos_text = __( 'Search Videos', 'feeds-for-youtube' );
$search_placeholder_text = __( 'Search...', 'feeds-for-youtube' );
$submit_text = __( 'Submit', 'feeds-for-youtube' );
?>
<div id="sby_search" class="sby_search">
<div class="sby_sf_label">
<label for="sby_sf_input"><?php echo esc_html( $search_videos_text ); ?></label>
</div>
<div class="sby_sf_input">
<form role="search" action="" method="get">
<input id="sby_sf_input" type="search" name="<?php echo esc_attr( $input_name ); ?>" value="<?php echo esc_attr( $search_term ); ?>" placeholder="<?php echo esc_attr( $search_placeholder_text ); ?>">
<button type="submit"><?php echo esc_html( $submit_text ); ?></button>
</form>
</div>
<?php
include sby_get_feed_template_part( 'results', $sby_settings );
?>
</div>

View File

@@ -0,0 +1,35 @@
<?php
$post_thumbnail = SBY_Parse::get_media_url( $api_data, 'high' );
$title = get_the_title( $youtube_post->ID );
$permalink = get_the_permalink( $youtube_post->ID );
$img_alt = sby_maybe_shorten_text( SBY_Parse::get_caption( $api_data, __( 'Image for post', 'feeds-for-youtube' ) . ' ' . $youtube_post->ID ), array() );
$caption = sby_maybe_shorten_text( SBY_Parse_Pro::get_caption( $api_data, '' ), array() );
$timestamp = SBY_Parse::get_timestamp( $api_data );
$live_broadcast_type = SBY_Parse_Pro::get_live_broadcast_content( $api_data ); // 'none', 'upcoming', 'live', 'completed'
$live_streaming_timestamp = SBY_Parse_Pro::get_live_streaming_timestamp( $api_data, $youtube_post_meta );
$live_streaming_time_string = SBY_Display_Elements_Pro::escaped_live_streaming_time_string( $api_data, $youtube_post_meta );
$formatted_date_string = $live_broadcast_type === 'none' ? SBY_Display_Elements_Pro::format_date( $timestamp, $settings ) : SBY_Display_Elements_Pro::format_date( $live_streaming_timestamp, $settings, true );
?>
<div class="sby_sf_result">
<div class="sby_sf_thumb_wrap">
<a href="<?php echo $permalink; ?>">
<img src="<?php echo esc_url( $post_thumbnail ); ?>" alt="<?php echo esc_attr( $img_alt ); ?>">
</a>
</div>
<div class="sby_sf_info_wrap">
<a href="<?php echo $permalink; ?>">
<h3><?php echo esc_html( $title ); ?></h3>
</a>
<p class="sby_sf_dates">
<?php if ( $live_broadcast_type !== 'none' ) : ?>
<span class="sby_ls_message_wrap"><span class="sby_ls_message"><?php echo $live_streaming_time_string; ?></span></span>
<?php endif; ?>
<span class="sby_date sby_live_broadcast_type_<?php echo esc_attr( $live_broadcast_type ); ?>"><?php echo $formatted_date_string; ?></span>
</p>
<p>
<?php echo $caption; ?>
</p>
</div>
</div>

View File

@@ -0,0 +1,4 @@
<div id="sby_sf_results_wrap" class="sby_sf_results_wrap">
<?php SBY_Search::results_loop( $results ); ?>
</div>

View File

@@ -0,0 +1,73 @@
<?php
use SmashBalloon\YouTubeFeed\Pro\SBY_CPT;
use SmashBalloon\YouTubeFeed\Pro\SBY_Display_Elements_Pro;
use SmashBalloon\YouTubeFeed\Pro\SBY_Parse_Pro;
use SmashBalloon\YouTubeFeed\SBY_Display_Elements;
use SmashBalloon\YouTubeFeed\SBY_Parse;
$sby_videos_settings = SBY_CPT::get_sby_cpt_settings();
/* Feed */
$feed_styles = SBY_Display_Elements::get_feed_style( $settings );
$cols_setting = SBY_Display_Elements::get_cols( $settings );
$mobile_cols_setting = SBY_Display_Elements::get_cols_mobile( $settings );
$items_wrap_classes = $settings['infoposition'] === 'side' ? ' sby_info_side' : '';
$items_wrap_style_attr = SBY_Display_Elements::get_style_att( 'items_wrap', $settings );
$num_setting = $settings['num'];
$nummobile_setting = $settings['nummobile'];
/* Player */
$post_id = SBY_Parse::get_post_id( $api_data );
$timestamp = SBY_Parse::get_timestamp( $api_data );
$video_id = SBY_Parse::get_video_id( $api_data );
$protocol = is_ssl() ? 'https' : 'http';
$media_url = SBY_Display_Elements::get_optimum_media_url( $api_data, $settings );
$media_full_res = SBY_Parse::get_media_url( $api_data );
$media_all_sizes_json = SBY_Parse::get_media_src_set( $api_data );
$permalink = SBY_Parse::get_permalink( $api_data );
$img_alt = SBY_Parse::get_caption( $api_data, __( 'Image for post', 'feeds-for-youtube' ) . ' ' . $post_id );
$player_outer_wrap_style_attr = SBY_Display_Elements::get_style_att( 'player_outer_wrap', $settings );
// Pro Elements
$caption = SBY_Parse_Pro::get_caption( $api_data, '' );
//$avatar = SBY_Parse_Pro::get_item_avatar( $post, $settings['feed_avatars'] );
$avatar = SBY_Parse_Pro::get_item_avatar( $api_data );
$title = SBY_Parse::get_video_title( $api_data );
$username = SBY_Parse_Pro::get_channel_title( $api_data, $youtube_post_meta );
$likes_count = SBY_Display_Elements_Pro::escaped_formatted_count_string( SBY_Parse_Pro::get_like_count( $api_data, $youtube_post_meta ), 'likes' );
$comments_count = SBY_Display_Elements_Pro::escaped_formatted_count_string( SBY_Parse_Pro::get_comment_count( $api_data, $youtube_post_meta ), 'comments' );
$views_count_string = SBY_Display_Elements_Pro::escaped_formatted_count_string( SBY_Parse_Pro::get_view_count( $api_data, $youtube_post_meta ), 'views' );
$flag_missing_counts = (SBY_Parse_Pro::get_view_count( $api_data, $youtube_post_meta ) === '') ? ',singleCheckPosts' : '';
$live_broadcast_type = SBY_Parse_Pro::get_live_broadcast_content( $api_data ); // 'none', 'upcoming', 'live', 'completed'
$live_streaming_timestamp = SBY_Parse_Pro::get_live_streaming_timestamp( $api_data, $youtube_post_meta );
$live_streaming_time_string = SBY_Display_Elements_Pro::escaped_live_streaming_time_string( $api_data, $youtube_post_meta );
$formatted_date_string = $live_broadcast_type === 'none' ? SBY_Display_Elements_Pro::format_date( $timestamp, $settings ) : SBY_Display_Elements_Pro::format_date( $live_streaming_timestamp, $settings, true );
// Pro Styles
$link_styles = SBY_Display_Elements_Pro::get_sby_link_styles( $settings ); // style="background: rgba(30,115,190,0.85)" already escaped
$hover_styles = SBY_Display_Elements_Pro::get_hover_styles( $settings ); // style="color: rgba(153,231,255,1)" already escaped
$sby_info_styles = SBY_Display_Elements_Pro::get_sby_info_styles( $settings ); // style="font-size: 13px;" already escaped
$sby_meta_color_styles = SBY_Display_Elements_Pro::get_sby_meta_color_styles( $settings ); // style="font-size: 13px;" already escaped
$sby_meta_size_color_styles = SBY_Display_Elements_Pro::get_sby_meta_size_color_styles( $settings ); // style="font-size: 13px;color: rgba(153,231,255,1)" already escaped
?>
<div id="sb_youtube_<?php echo esc_attr( preg_replace( "/[^A-Za-z0-9 ]/", '', $post_id ) ); ?>" class="sb_youtube sby_layout_gallery sby_col_1 sby_mob_col_1 sby_youtube_feed_single" data-shortcode-atts="<?php echo esc_attr( $shortcode_atts ); ?>" data-cols="1" data-colsmobile="1" data-num="1" data-sby-flags="resizeDisable<?php echo esc_attr( $flag_missing_counts ); ?>"<?php echo $other_atts; ?>>
<div id="sby_player_<?php echo esc_attr( $post_id ); ?>" class="sby_player_outer_wrap sby_player_item">
<div class="sby_video_thumbnail_wrap">
<a class="sby_video_thumbnail sby_player_video_thumbnail" href="<?php echo esc_url( $permalink ); ?>" target="_blank" rel="noopener" data-title="<?php echo sby_esc_html_with_br( $caption ); ?>" data-full-res="<?php echo esc_url( $media_full_res ); ?>" data-img-src-set="<?php echo esc_attr( wp_json_encode( $media_all_sizes_json ) ); ?>" data-video-id="<?php echo esc_attr( $video_id ); ?>">
<span class="sby-screenreader"><?php echo sprintf( __( 'YouTube Video %s', 'feeds-for-youtube' ), $post_id ); ?></span>
<img src="<?php echo esc_url( $media_url ); ?>" alt="<?php echo esc_attr( $img_alt ); ?>">
<span class="sby_loader sby_hidden" style="background-color: rgb(255, 255, 255);"></span>
</a>
<div class="sby_player_wrap">
<div class="sby_player"></div>
</div>
<?php include sby_get_feed_template_part( 'cta', $settings ); ?>
</div>
<?php
$context = 'single';
include sby_get_feed_template_part( 'info', $settings ); ?>
</div>
</div>