Upload via Git Manager GUI - test-render.php
This commit is contained in:
@@ -1,69 +1,69 @@
|
|||||||
<?php
|
<?php
|
||||||
define('WP_USE_THEMES', false);
|
define('WP_USE_THEMES', false);
|
||||||
require('../../../wp-load.php');
|
require('../../../wp-load.php');
|
||||||
|
|
||||||
echo "=== Testing Livestream Rendering ===\n\n";
|
echo "=== Testing Livestream Rendering ===\n\n";
|
||||||
|
|
||||||
// Query für Videos mit Livestream
|
// Query für Videos mit Livestream
|
||||||
$args = array(
|
$args = array(
|
||||||
'post_type' => 'video',
|
'post_type' => 'video',
|
||||||
'posts_per_page' => 2,
|
'posts_per_page' => 2,
|
||||||
'meta_query' => array(
|
'meta_query' => array(
|
||||||
array(
|
array(
|
||||||
'key' => 'video_is_livestream',
|
'key' => 'video_is_livestream',
|
||||||
'value' => '1',
|
'value' => '1',
|
||||||
'compare' => '='
|
'compare' => '='
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$query = new WP_Query($args);
|
$query = new WP_Query($args);
|
||||||
|
|
||||||
if ($query->have_posts()) {
|
if ($query->have_posts()) {
|
||||||
while ($query->have_posts()) {
|
while ($query->have_posts()) {
|
||||||
$query->the_post();
|
$query->the_post();
|
||||||
|
|
||||||
$post_id = get_the_ID();
|
$post_id = get_the_ID();
|
||||||
$profile_url = get_post_meta($post_id, 'video_livestream_profile_url', true);
|
$profile_url = get_post_meta($post_id, 'video_livestream_profile_url', true);
|
||||||
$player_url = get_post_meta($post_id, 'video_livestream_player_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);
|
$youtube_channel_id = get_post_meta($post_id, 'video_youtube_channel_id', true);
|
||||||
|
|
||||||
echo "Post ID: $post_id\n";
|
echo "Post ID: $post_id\n";
|
||||||
echo "Title: " . get_the_title() . "\n";
|
echo "Title: " . get_the_title() . "\n";
|
||||||
echo "Profile URL: $profile_url\n";
|
echo "Profile URL: $profile_url\n";
|
||||||
echo "Player URL: $player_url\n";
|
echo "Player URL: $player_url\n";
|
||||||
echo "YouTube Channel ID: $youtube_channel_id\n";
|
echo "YouTube Channel ID: $youtube_channel_id\n";
|
||||||
|
|
||||||
$data = mm_video_get_livestream_data($profile_url, $player_url, $youtube_channel_id);
|
$data = mm_video_get_livestream_data($profile_url, $player_url, $youtube_channel_id);
|
||||||
|
|
||||||
echo "\nLivestream Data:\n";
|
echo "\nLivestream Data:\n";
|
||||||
echo " Platform: " . ($data['platform'] ?? 'N/A') . "\n";
|
echo " Platform: " . ($data['platform'] ?? 'N/A') . "\n";
|
||||||
echo " Video ID: " . ($data['video_id'] ?? 'EMPTY') . "\n";
|
echo " Video ID: " . ($data['video_id'] ?? 'EMPTY') . "\n";
|
||||||
echo " Embed URL: " . ($data['embed_url'] ?? 'EMPTY') . "\n";
|
echo " Embed URL: " . ($data['embed_url'] ?? 'EMPTY') . "\n";
|
||||||
echo " Profile URL: " . ($data['profile_url'] ?? 'N/A') . "\n";
|
echo " Profile URL: " . ($data['profile_url'] ?? 'N/A') . "\n";
|
||||||
|
|
||||||
echo "\n" . str_repeat("-", 80) . "\n\n";
|
echo "\n" . str_repeat("-", 80) . "\n\n";
|
||||||
}
|
}
|
||||||
wp_reset_postdata();
|
wp_reset_postdata();
|
||||||
} else {
|
} else {
|
||||||
echo "No livestream videos found.\n";
|
echo "No livestream videos found.\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test the groups
|
// Test the groups
|
||||||
echo "\n=== Testing Group Generation ===\n\n";
|
echo "\n=== Testing Group Generation ===\n\n";
|
||||||
$groups = mm_video_get_livestream_groups();
|
$groups = mm_video_get_livestream_groups();
|
||||||
echo "Found " . count($groups) . " groups\n\n";
|
echo "Found " . count($groups) . " groups\n\n";
|
||||||
|
|
||||||
foreach ($groups as $idx => $group) {
|
foreach ($groups as $idx => $group) {
|
||||||
echo "Group $idx: " . $group['owner'] . "\n";
|
echo "Group $idx: " . $group['owner'] . "\n";
|
||||||
echo " Items: " . count($group['items']) . "\n";
|
echo " Items: " . count($group['items']) . "\n";
|
||||||
|
|
||||||
foreach ($group['items'] as $item_idx => $item) {
|
foreach ($group['items'] as $item_idx => $item) {
|
||||||
echo " Item $item_idx:\n";
|
echo " Item $item_idx:\n";
|
||||||
echo " Title: " . $item['title'] . "\n";
|
echo " Title: " . $item['title'] . "\n";
|
||||||
echo " Platform: " . $item['stream']['platform'] . "\n";
|
echo " Platform: " . $item['stream']['platform'] . "\n";
|
||||||
echo " Video ID: " . ($item['stream']['video_id'] ?? 'EMPTY') . "\n";
|
echo " Video ID: " . ($item['stream']['video_id'] ?? 'EMPTY') . "\n";
|
||||||
echo " Embed URL: " . (empty($item['stream']['embed_url']) ? 'EMPTY' : 'SET') . "\n";
|
echo " Embed URL: " . (empty($item['stream']['embed_url']) ? 'EMPTY' : 'SET') . "\n";
|
||||||
}
|
}
|
||||||
echo "\n";
|
echo "\n";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user