apply_filters( 'sports_bench_scoreboard_modal', $html, $game, $away_team, $home_team, $status, $time, $period )

Type

Filters

Section

Scoreboard

Outputs the HTML for a modal if you want to use one or are using the Sports Bench theme

Parameters

  • $html, string, the current HTML for the modal
  • $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
  • $home_team, Sports_Bench_Team object, the team object for the home team
  • $status, string, the status for the game
  • $time, string, the current time in the game
  • $period, string, the current period, half, set or quarter the game is in

Returns

  • string, the HTML for the modal

Since: 1.5

Source: scoreboard.php, line 520, 686

Example

function sports_bench_do_game_modal( $html, $game, $away_team, $home_team, $status, $time, $period ) {
	$theme = wp_get_theme();
	$parent_theme = $theme->parent();
	if ( $status == 'in_progress' && ( $theme->name != 'Sports Bench' || ( $parent_theme && $parent_theme->name != 'Sports Bench' ) ) ) {
		if ( $game->game_current_period != null and $game->game_current_time != null ) {
			$time_in_game = '' . $time . '
' . $period . ''; } else { $time_in_game = '' . $time . ''; } if ( $away_team->team_nickname != null ) { $away_team_name = '' . $away_team->team_location . '
' . $away_team->team_nickname . ''; } else { $away_team_name = $away_team->team_location; } if ( $home_team->team_nickname != null ) { $home_team_name = '' . $home_team->team_location . '
' . $home_team->team_nickname . ''; } else { $home_team_name = $home_team->team_location; } $away_score = $game->game_current_away_score; $home_score = $game->game_current_home_score; $id = 'game-' . $game->game_id; $game_id = $game->game_id; $html .= '
'; $html .= '
'; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= '
' . $away_team_name . '' . $time_in_game . '' . $home_team_name . '
'; $html .= sports_bench_get_linescore_display( $game_id ); if ( get_option( 'sports-bench-sport' ) != 'basketball' ) { $html .= ''; $html .= sports_bench_get_score_info( $game_id ); } $html .= '
'; $html .= ''; $html .= '
'; } return $html; } add_filter( 'sports_bench_scoreboard_modal', 'sports_bench_do_game_modal', 10, 7 );