apply_filters( 'sports_bench_game_preview', $html, $game, $away_team, $away_team_name, $away_record, $away_score, $home_team, $home_team_name, $home_record, $home_score )

Type

Filters

Section

Game Preview

Outputs the game preview

Parameters

  • $html, string, the current html that's being outputted
  • $game, Sports_Bench_Game object, the game object for the current game
  • $away_team, Sports_Bench_Team object, the team object for the away team
  • $away_team_name, string, team name for the away team
  • $away_record, string, the record for the away team
  • $away_score, integer, the score for the away team if the game is over
  • $home_team, Sports_Bench_Team object, the team object for the home team
  • $home_team_name, string, team name for the home team
  • $home_record, string, the record for the home team
  • $home_score, integer, the score for the home team if the game is over

Returns

  • string, the html for the game preview

Since: 1.5

Source: display-functions.php, line 149

Example

/**
 * Returns the HTML for a game preview
 *
 * @param $html, current html for the game preview
 *
 * @param $game, the Game Class for the game
 *
 * @param $away_team, the Team Class for the away team
 *
 * @param $away_team_name, the team name for the away team
 *
 * @param $away_record, the record for the away team
 *
 * @param $away_score, the score for the away team
 *
 * @param $away_team, the Team Class for the home team
 *
 * @param $away_team_name, the team name for the home team
 *
 * @param $away_record, the record for the home team
 *
 * @param $away_score, the score for the home team
 *
 * @return string, html for the game preview
 *
 * @since 1.5
 */
function sports_bench_theme_game_preview( $html, $game, $away_team, $away_team_name, $away_record, $away_score, $home_team, $home_team_name, $home_record, $home_score ) {
	$html .= '
'; $html .= ''; $html .= '
'; return $html; } remove_filter( 'sports_bench_game_preview', 'sports_bench_do_game_preview' ); add_filter( 'sports_bench_game_preview', 'sports_bench_theme_game_preview', 10, 10 );