apply_filters( 'sports_bench_game_info', $html, $game, $home_team )

Type

Filters

Section

Game Recap

Outputs the HTML for the game information section

Parameters

  • $html, string, the current html that's being outputted
  • $game, Sports_Bench_Game object, the game object for the current game
  • $home_team, Sports_Bench_Team object, the team object for the home team

Returns

  • string, HTML for the game information section

Since: 1.5

Source: display-functions.php, line 265

Example

/**
 * Returns the html for the game information section
 *
 * @param string $html
 *
 * @param Sports_Bench_Game $game
 *
 * @param Sports_Bench_Team $home_team
 *
 * @return string, html for game information section
 *
 * @since 1.5
 */
function sports_bench_do_game_info( $html, $game, $home_team ) {
	$datetime = date_create( $game->game_day );
	$datetime = date_format( $datetime, 'g:i a, F j, Y' );

	if ( $game->game_attendance != null ) {
		$html .= '

' . __( 'Attendance: ', 'sports-bench' ) . $game->game_attendance . '

'; } $html .= '

' . $datetime . '

'; $html .= '

' . $game->game_location_stadium . ', ' . $game->game_location_city . ', ' . $game->game_location_state . '

'; return $html; } add_filter( 'sports_bench_game_info', 'sports_bench_do_game_info', 10, 3 );