From 24874054919f43f24153b4f5bc51c8edeb238ffa Mon Sep 17 00:00:00 2001 From: M_Viper Date: Sun, 29 Mar 2026 22:29:43 +0200 Subject: [PATCH] Upload file test-render.php via GUI --- Minecraft-Modern-Theme/test-render.php | 69 ++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 Minecraft-Modern-Theme/test-render.php diff --git a/Minecraft-Modern-Theme/test-render.php b/Minecraft-Modern-Theme/test-render.php new file mode 100644 index 0000000..7804fd1 --- /dev/null +++ b/Minecraft-Modern-Theme/test-render.php @@ -0,0 +1,69 @@ + 'video', + 'posts_per_page' => 2, + 'meta_query' => array( + array( + 'key' => 'video_is_livestream', + 'value' => '1', + 'compare' => '=' + ) + ) +); + +$query = new WP_Query($args); + +if ($query->have_posts()) { + while ($query->have_posts()) { + $query->the_post(); + + $post_id = get_the_ID(); + $profile_url = get_post_meta($post_id, 'video_livestream_profile_url', true); + $player_url = get_post_meta($post_id, 'video_livestream_player_url', true); + $youtube_channel_id = get_post_meta($post_id, 'video_youtube_channel_id', true); + + echo "Post ID: $post_id\n"; + echo "Title: " . get_the_title() . "\n"; + echo "Profile URL: $profile_url\n"; + echo "Player URL: $player_url\n"; + echo "YouTube Channel ID: $youtube_channel_id\n"; + + $data = mm_video_get_livestream_data($profile_url, $player_url, $youtube_channel_id); + + echo "\nLivestream Data:\n"; + echo " Platform: " . ($data['platform'] ?? 'N/A') . "\n"; + echo " Video ID: " . ($data['video_id'] ?? 'EMPTY') . "\n"; + echo " Embed URL: " . ($data['embed_url'] ?? 'EMPTY') . "\n"; + echo " Profile URL: " . ($data['profile_url'] ?? 'N/A') . "\n"; + + echo "\n" . str_repeat("-", 80) . "\n\n"; + } + wp_reset_postdata(); +} else { + echo "No livestream videos found.\n"; +} + +// Test the groups +echo "\n=== Testing Group Generation ===\n\n"; +$groups = mm_video_get_livestream_groups(); +echo "Found " . count($groups) . " groups\n\n"; + +foreach ($groups as $idx => $group) { + echo "Group $idx: " . $group['owner'] . "\n"; + echo " Items: " . count($group['items']) . "\n"; + + foreach ($group['items'] as $item_idx => $item) { + echo " Item $item_idx:\n"; + echo " Title: " . $item['title'] . "\n"; + echo " Platform: " . $item['stream']['platform'] . "\n"; + echo " Video ID: " . ($item['stream']['video_id'] ?? 'EMPTY') . "\n"; + echo " Embed URL: " . (empty($item['stream']['embed_url']) ? 'EMPTY' : 'SET') . "\n"; + } + echo "\n"; +}