apply_filters( 'sports_bench_game_shortcode_info', $html, $game, $away_team, $away_team_name, $away_score, $home_team, $home_team_name, $home_score, $time_in_game, $location )

Type

Filters

Section

Games
Shortcodes

Outputs the HTML for the game information section of the game shortcode

Parameters

  • $html, string, the current HTML for before the player shortcode
  • $game, Sports_Bench_Game object, the game object for the selected game
  • $away_team, Sports_Bench_Team object, the team object for the away team
  • $away_team_name, string, the team name for the away team
  • $away_score, string, the score for the away team if the game is final
  • $home_team, Sports_Bench_Team object, the team object for the home team
  • $home_team_name, string, the team name for the home team
  • $home_score, string, the score for the home team if the game is final
  • $time_in_game, string, the current time and period for the game if it is in progress, otherwise it's the date and time of the game or final
  • $location, string, the location for the game

Returns

  • string, the HTML to be outputted for the game information section of the game shortcode

Since: 1.5

Source: shortcodes.php, line 160

Example

function sports_bench_do_game_shortcode_info( $html, $game, $away_team, $away_team_name, $away_score, $home_team, $home_team_name, $home_score, $time_in_game, $location ) {
	if ( $game->game_status != 'final' ) {
		$time_class = 'scheduled';
	} else {
		$time_class = '';
	}

	$html .= '';
	$table_row_styles = apply_filters( 'sports_bench_game_shortcode_game_row', '', $game->game_id, $away_team, $home_team );
	$html .= '';
	$html .= '';
	$html .= '';
	$html .= '';
	$html .= '';
	$html .= '';
	$html .= '';
	$html .= '';
	$html .= '';
	$html .= '
' . $away_team_name . '' . $time_in_game . '' . $home_team_name . '
'; $html .= '
' . $location . '
'; if ( $game->game_status == 'final' and $game->recap_link != null ) { $html .= '' . __( 'View Stats and Recap', 'sports-bench' ) . ''; } if ( $game->game_status == 'scheduled' ) { $html .= sports_bench_show_google_maps( $game ); } return $html; } add_filter( 'sports_bench_game_shortcode_info', 'sports_bench_do_game_shortcode_info', 10, 10 );