function display_player_stats_on_match_shortcode($atts) { // Shortcode attributes with default values $atts = shortcode_atts(['match_id' => ''], $atts, 'player_stats_on_venue'); // Validate match ID if (empty($atts['match_id'])) { return '

Error: Match ID is required.

'; } $match_id = sanitize_text_field($atts['match_id']); $match_info_url = API_CALL_BASE_URL . "v4/matches/$match_id/advance?token=" . GENERATE_DRAFT_TOKEN; // Fetch match info $match_response = wp_remote_get($match_info_url); if (is_wp_error($match_response)) { // Debug API request error return '

Error: Unable to fetch match info. Debug: ' . $match_response->get_error_message() . '

'; } $match_response_code = wp_remote_retrieve_response_code($match_response); if ($match_response_code !== 200) { // Debug non-200 response return '

Error: Unable to fetch match info. API returned an error code: ' . $match_response_code . '

'; } $match_data = json_decode(wp_remote_retrieve_body($match_response), true); // Debug: Show the full match data array live on the page $debug_output = '

Debug: Full API Response

'; $debug_output .= '
' . print_r($match_data, true) . '
'; // Extract venue and team data $venue_name = $match_data['response']['items']['info']['venue']['name'] ?? 'Unknown Venue'; $team1_name = $match_data['response']['items']['info']['teama']['name'] ?? 'Team 1'; $team2_name = $match_data['response']['items']['info']['teamb']['name'] ?? 'Team 2'; // Extract player stats $batting_stats_team1 = $match_data['response']['items']['player_batting_stats_on_venue']['team1'] ?? []; $bowling_stats_team1 = $match_data['response']['items']['player_bowling_stats_on_venue']['team1'] ?? []; $batting_stats_team2 = $match_data['response']['items']['player_batting_stats_on_venue']['team2'] ?? []; $bowling_stats_team2 = $match_data['response']['items']['player_bowling_stats_on_venue']['team2'] ?? []; // Debug: Show extracted data live on the page $debug_output .= '

Debug: Extracted Data

'; $debug_output .= '
Batting Stats - Team 1
'; $debug_output .= '
' . print_r($batting_stats_team1, true) . '
'; $debug_output .= '
Bowling Stats - Team 1
'; $debug_output .= '
' . print_r($bowling_stats_team1, true) . '
'; $debug_output .= '
Batting Stats - Team 2
'; $debug_output .= '
' . print_r($batting_stats_team2, true) . '
'; $debug_output .= '
Bowling Stats - Team 2
'; $debug_output .= '
' . print_r($bowling_stats_team2, true) . '
'; // Build the HTML output $html = "

Player Stats for Venue: $venue_name

"; // Display stats for Team 1 $html .= "

Batting Stats - $team1_name

"; $html .= generate_batting_table($batting_stats_team1); $html .= "

Bowling Stats - $team1_name

"; $html .= generate_bowling_table($bowling_stats_team1); // Display stats for Team 2 $html .= "

Batting Stats - $team2_name

"; $html .= generate_batting_table($batting_stats_team2); $html .= "

Bowling Stats - $team2_name

"; $html .= generate_bowling_table($bowling_stats_team2); // Append debug output to the end $html .= $debug_output; return $html; } // Helper function to generate batting stats table function generate_batting_table($batting_stats) { if (empty($batting_stats)) { return '

No batting stats available.

'; } $html = ""; foreach ($batting_stats as $player) { $html .= ""; } $html .= "
Player Innings Runs 50s 100s Average Strike Rate
{$player['batsman_title']} {$player['innings']} {$player['runs']} {$player['run50']} {$player['run100']} {$player['average']} {$player['strike']}
"; return $html; } // Helper function to generate bowling stats table function generate_bowling_table($bowling_stats) { if (empty($bowling_stats)) { return '

No bowling stats available.

'; } $html = ""; foreach ($bowling_stats as $player) { $html .= ""; } $html .= "
Player Innings Balls Runs Wickets Economy Average Strike Rate
{$player['bowler_title']} {$player['innings']} {$player['balls']} {$player['runs']} {$player['wickets']} {$player['econ']} {$player['average']} {$player['strike']}
"; return $html; } // Register the shortcode add_shortcode('player_stats_on_venue', 'display_player_stats_on_match_shortcode'); HT vs MD Live Score, 27th Match, Maharaja T20 Trophy Live Score and Commentary | Hubli Tigers vs Mangaluru Dragons Full Scorecard 2023

Hubli Tigers vs Mangaluru Dragons Live Cricket Score, 27th Match, Maharaja T20 Trophy, 2023

Maharaja T20 Trophy
Finished
, August 26, 2023
Hubli Tigers
HT
170/5 (18.2)
Mangaluru Dragons
MD
167/9 (20)
HT won by 5 wickets
Match Details
Date
2023-08-26 13:00 PM
Venue
M.Chinnaswamy Stadium, Bengaluru
Toss
Hubli Tigers elected to bowl
Umpires
  • KR Vasuki
  • Nagaraj Ramesh
Tv Umpires
  • Darshan Hurkadli
Match Referee
  • Balachandra Akhil
MyFinal11 Pro Fantasy Guide
Sticky Footer Ad
WhatsApp Telegram

Get Fantasy Tips