Upload via Git Manager GUI - test-filter.php

This commit is contained in:
2026-03-30 18:42:39 +00:00
parent 62bab14817
commit db2ca87135

View File

@@ -1,52 +1,52 @@
<?php <?php
define('WP_USE_THEMES', false); define('WP_USE_THEMES', false);
require('../../../wp-load.php'); require('../../../wp-load.php');
echo "=== Debug: Livestream Filtering ===\n\n"; echo "=== Debug: Livestream Filtering ===\n\n";
$args = array( $args = array(
'post_type' => 'mm_livestream', 'post_type' => 'mm_livestream',
'posts_per_page' => -1, 'posts_per_page' => -1,
'post_status' => 'publish', 'post_status' => 'publish',
); );
$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, '_mm_livestream_url', true); $profile_url = get_post_meta($post_id, '_mm_livestream_url', true);
$player_url = get_post_meta($post_id, '_mm_livestream_player_url', true); $player_url = get_post_meta($post_id, '_mm_livestream_player_url', true);
$youtube_channel_id = get_post_meta($post_id, '_mm_livestream_youtube_channel_id', true); $youtube_channel_id = get_post_meta($post_id, '_mm_livestream_youtube_channel_id', true);
$owner = get_post_meta($post_id, '_mm_livestream_owner', true); $owner = get_post_meta($post_id, '_mm_livestream_owner', true);
echo "Post #$post_id: " . get_the_title() . "\n"; echo "Post #$post_id: " . get_the_title() . "\n";
echo " Owner: $owner\n"; echo " Owner: $owner\n";
echo " Profile: $profile_url\n"; echo " Profile: $profile_url\n";
echo " Player: $player_url\n"; echo " Player: $player_url\n";
echo " Channel ID: $youtube_channel_id\n"; echo " Channel ID: $youtube_channel_id\n";
$stream = mm_video_get_livestream_data($profile_url, $player_url, $youtube_channel_id); $stream = mm_video_get_livestream_data($profile_url, $player_url, $youtube_channel_id);
echo " Platform: " . $stream['platform'] . "\n"; echo " Platform: " . $stream['platform'] . "\n";
echo " Video ID: " . ($stream['video_id'] ?? 'EMPTY') . "\n"; echo " Video ID: " . ($stream['video_id'] ?? 'EMPTY') . "\n";
echo " Embed URL: " . ($stream['embed_url'] ?? 'EMPTY') . "\n"; echo " Embed URL: " . ($stream['embed_url'] ?? 'EMPTY') . "\n";
if ($stream['platform'] === 'youtube') { if ($stream['platform'] === 'youtube') {
$video_id = $stream['video_id'] ?? ''; $video_id = $stream['video_id'] ?? '';
if ($video_id) { if ($video_id) {
$is_live = mm_video_check_youtube_live_status($video_id); $is_live = mm_video_check_youtube_live_status($video_id);
echo " Live Status Check: " . ($is_live ? 'LIVE ✓' : 'NOT LIVE ✗') . "\n"; echo " Live Status Check: " . ($is_live ? 'LIVE ✓' : 'NOT LIVE ✗') . "\n";
} else { } else {
echo " Live Status Check: SKIPPED (no video_id)\n"; echo " Live Status Check: SKIPPED (no video_id)\n";
} }
} }
echo "\n"; echo "\n";
} }
wp_reset_postdata(); wp_reset_postdata();
} else { } else {
echo "No livestream posts found!\n"; echo "No livestream posts found!\n";
} }