apply_filters( 'sports_bench_game_events', $html, $events, $away_team, $home_team, $sport )
Type
Filters
Section
Game Recap
Outputs the HTML for the game events table for a game
Parameters
- $html, string, the current HTML for the game events table
- $events, array, the list of game events for the selected game
- $away_team, Sports_Bench_Team object, the team object for the away team
- $home_team, Sports_Bench_Team object, the team object for the home team
- $sport, string, the sport that's being used on the site
Returns
- string, the HTML for the game events table
Since: 1.5
Source: baseball-game-info.php, line 123; football-game-info.php, line 53; hockey-game-info.php, line 55; rugby-game-info.php, line 54; soccer-game-info.php, line 52
Example
/** * Returns the html for the game events table for a game recap * * @param string $html * * @param array $events * * @param Sports_Bench_Team $away_team * * @param Sports_Bench_Team $home_team * * @param string $sport * * @return string, html for the game events table * * @since 1.5 */ function sports_bench_do_game_events( $html, $events, $away_team, $home_team, $sport ) { if ( 'baseball' == $sport ) { $html = '
'; $html .= ' | ' . $away_team->get_team_photo( 'team-logo' ) . ' ' . $away_team->team_abbreviation . ' | ';
$html .= '' . $home_team->get_team_photo( 'team-logo' ) . ' ' . $home_team->team_abbreviation . ' | ';
$html .= ''; $html .= ' |
---|---|---|---|
' . $logo . ' ' . $event->game_info_top_bottom . ' ' . $event->game_info_inning . ' | ';
$html .= '' . $event->game_info_away_score . ' | '; $html .= '' . $event->game_info_home_score . ' | '; $html .= '' . $event->game_info_score_play . ' | '; $html .= '
'; $html .= ' | '; $html .= ' | '; $html .= ' | ' . $away_team->get_team_photo( 'team-logo' ) . ' ' . $away_team->team_abbreviation . ' | ';
$html .= '' . $home_team->get_team_photo( 'team-logo' ) . ' ' . $home_team->team_abbreviation . ' | ';
$html .= '
---|---|---|---|---|
' . __( 'First Quarter', 'sports-bench' ) . ' | ||||
' . __( 'Second Quarter', 'sports-bench' ) . ' | ||||
' . __( 'Third Quarter', 'sports-bench' ) . ' | ||||
' . __( 'Fourth Quarter', 'sports-bench' ) . ' | ||||
' . __( 'Overtime', 'sports-bench' ) . ' | ||||
' . $team->get_team_photo( 'team-logo' ) . ' | '; $html .= '' . $event->game_info_time . ' | '; $html .= '' . $event->game_info_play . ' | '; $html .= '' . $event->game_info_away_score . ' | '; $html .= '' . $event->game_info_home_score . ' | '; $html .= '
'; $html .= ' | '; $html .= ' | '; $html .= ' | ' . $away_team->get_team_photo( 'team-logo' ) . ' | '; $html .= '' . $home_team->get_team_photo( 'team-logo' ) . ' | '; $html .= '
---|---|---|---|---|
' . __( 'Goals', 'sports-bench' ) . ' | ||||
' . __( 'First Period', 'sports-bench' ) . ' | ||||
' . __( 'Second Period', 'sports-bench' ) . ' | ||||
' . __( 'Third Period', 'sports-bench' ) . ' | ||||
' . __( 'Overtime', 'sports-bench' ) . ' | ||||
' . $team->get_team_photo( 'team-logo' ) . ' | '; $html .= '' . $goal->game_info_time . ' | '; $html .= '' . __( 'Goal scored by ', 'sports-bench' ) . $player_name . '. ' . $assist . ' | '; $html .= '' . $away_score . ' | '; $html .= '' . $home_score . ' | '; $html .= '
' . __( 'Penalties', 'sports-bench' ) . ' | ||||
' . __( 'First Period', 'sports-bench' ) . ' | ||||
' . __( 'Second Period', 'sports-bench' ) . ' | ||||
' . __( 'Third Period', 'sports-bench' ) . ' | ||||
' . __( 'Overtime', 'sports-bench' ) . ' | ||||
' . $team->get_team_photo( 'team-logo' ) . ' | '; $html .= '' . $penalty->game_info_time . ' | '; $html .= '' . $player_name . ' ' . $penalty->game_info_penalty . ' | '; $html .= '
'; $html .= ' | ' . $away_team->get_team_photo( 'team-logo' ) . ' ' . $away_team->team_abbreviation . ' | ';
$html .= '' . $home_team->get_team_photo( 'team-logo' ) . ' ' . $home_team->team_abbreviation . ' | ';
$html .= ''; $html .= ' |
' . $logo . ' ' . $event->game_info_time . '\' | ';
$html .= '' . $event->game_info_away_score . ' | '; $html .= '' . $event->game_info_home_score . ' | '; $html .= '' . $event->game_info_event . ' — ' . $player->player_first_name . ' ' . $player->player_last_name . ' | '; $html .= '
' . __( 'Match Events', 'sports-bench' ) . ' | '; $html .= '|
---|---|
' . $team->get_team_photo( 'team-logo' ) . ' | '; $html .= '' . $event->game_info_time . "' — " . $event->game_info_event . ': ' . $player->player_first_name . ' ' . $player->player_last_name . $assist . ' | '; $html .= '