+
+
+
+
+
+ 'mm_video',
+ 'posts_per_page' => -1,
+ 'orderby' => 'menu_order date',
+ 'order' => 'ASC',
+ ) );
+
+ if ( $query->have_posts() ) : ?>
+
+
+ have_posts() ) : $query->the_post();
+ $url = get_post_meta( get_the_ID(), '_mm_video_url', true );
+ $category = get_post_meta( get_the_ID(), '_mm_video_category', true );
+ $thumb = get_the_post_thumbnail_url( get_the_ID(), 'medium_large' );
+ $type = $url ? mm_video_get_type( $url ) : 'unknown';
+
+ if ( ! $thumb && $url && $type === 'youtube' ) {
+ if ( preg_match( '/(?:youtube\.com\/(?:watch\?v=|shorts\/)|youtu\.be\/)([a-zA-Z0-9_-]{11})/', $url, $m ) ) {
+ $thumb = 'https://img.youtube.com/vi/' . $m[1] . '/maxresdefault.jpg';
+ }
+ }
+
+ $platform_icons = array(
+ 'youtube' => array( 'icon' => 'fab fa-youtube', 'color' => '#ff0000' ),
+ 'vimeo' => array( 'icon' => 'fab fa-vimeo-v', 'color' => '#1ab7ea' ),
+ 'twitch' => array( 'icon' => 'fab fa-twitch', 'color' => '#9146ff' ),
+ 'mp4' => array( 'icon' => 'fas fa-film', 'color' => '#aaa' ),
+ );
+ $platform = isset( $platform_icons[$type] ) ? $platform_icons[$type] : array( 'icon' => 'fas fa-play', 'color' => '#aaa' );
+ ?>
+
+
+
+
; ?>)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+