<?php
/**
 * Video broadcaster content
 *
 * @package wpstream-theme
 */

$wpstream_get_post_type = $post->post_type;
$author_id              = wpstream_get_author_id( $post->ID );
$use_transient          = wpstream_theme_return_use_transient();
$transient_key          = 'wpstream_product_broadcaster_vod_query_' . $author_id;

$broadcaster_video_query_args = array(
	'post_status'    => 'publish',
	'post_type'      => $wpstream_get_post_type,
	'posts_per_page' => 4,
	'orderby'        => 'date',
	'order'          => 'DESC',
	'author'         => $author_id,
);

$query = wpstream_theme_custom_query( $broadcaster_video_query_args, $transient_key, $use_transient );

if ( $query->found_posts > 0 ) { ?>

	<section class="wpstream_section wpstream_broadcaster_section">

		<div class="<?php echo esc_attr( wpstream_theme_container_class() ); ?>">

			<div class="wpstream_section-line mb-3"></div>

			<div class="wpstream-grid-main">
				<h2 class="title-more">

					<?php
					echo esc_html( $wpstream_section_title ?? '' );
					?>

					<a href="<?php echo esc_url( wpstream_get_single_post_author_link( $post->ID ) ); ?>">
						<?php esc_html_e( 'See more', 'hello-wpstream' ); ?>
						<?php echo wpstream_theme_get_svg_icon( 'right-arrow.svg' );//phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
					</a>

				</h2>
				<div class="row">
					<?php
					include get_template_directory() . '/template-parts/single/video-loop-content.php';
					?>
				</div>
			</div>
		</div>
	</section>
	<?php
}
?>