function player_vs_player_shortcode($atts) { $atts = shortcode_atts(['match_id' => ''], $atts); $match_id = $atts['match_id']; if (!$match_id) { return "

Error: Match ID is required.

"; } // Fetch squads data $squads_data = fetch_match_squads_v2($match_id); if (!$squads_data) { return "

Error: Unable to fetch squads for Match ID {$match_id}. Please try again later.

"; } $players = []; $response = $squads_data['response']; if (isset($response['teama']['squads'])) { foreach ($response['teama']['squads'] as $player) { $players['teama'][$player['player_id']] = $player['name']; } } if (isset($response['teamb']['squads'])) { foreach ($response['teamb']['squads'] as $player) { $players['teamb'][$player['player_id']] = $player['name']; } } // Prepare HTML $output = '
'; $output .= '

Player vs Player Stats

'; // Dropdown filters $output .= '
'; $output .= ''; $output .= ''; $output .= ''; $output .= '
'; // Result table $output .= ''; $output .= ''; $output .= '
Batter NameBowler NameRunsBallsWickets
'; $output .= '
'; // JavaScript for the Show button $output .= ''; return $output; } add_shortcode('player_vs_player_stats', 'player_vs_player_shortcode');
Warning: Cannot modify header information - headers already sent by (output started at /home/myfinjex/public_html/wp-content/plugins/cricket-live-dream11/includes/player-vs-player-api.php:1) in /home/myfinjex/public_html/wp-content/plugins/digits/includes/core/digits_session.php on line 121

Warning: Cannot modify header information - headers already sent by (output started at /home/myfinjex/public_html/wp-content/plugins/cricket-live-dream11/includes/player-vs-player-api.php:1) in /home/myfinjex/public_html/wp-content/plugins/digits/includes/core/digits_session.php on line 121

Warning: Cannot modify header information - headers already sent by (output started at /home/myfinjex/public_html/wp-content/plugins/cricket-live-dream11/includes/player-vs-player-api.php:1) in /home/myfinjex/public_html/wp-includes/pluggable.php on line 1435

Warning: Cannot modify header information - headers already sent by (output started at /home/myfinjex/public_html/wp-content/plugins/cricket-live-dream11/includes/player-vs-player-api.php:1) in /home/myfinjex/public_html/wp-includes/pluggable.php on line 1438