apply_filters( 'sports_bench_team_stats_table', $html, $player_stats_array, $sport )

Type

Filters

Section

Teams

Outputs the HTML for the player stats table for a team

Parameters

  • $html, string, the current HTML for the player stats table
  • $player_stats_array, array, the stats for the table
  • $sport, string, the sport that's being used on the site

Returns

  • string, the HTML for the team's player's stats table

Since: 1.5

Source: baseball-team-info.php, line 93; basketball-team-info.php, line 85; football-team-info.php, line 97; hockey-team-info.php, line 82; rugby-team-info.php, line 76; soccer-game-info.php, line 78; volleyball-team-info.php, line 83

Example

/**
 * Returns the html for the team stats table
 *
 * @param string $html
 *
 * @param array $stats
 *
 * @param string $sport
 *
 * @return string, html for the team stats table
 *
 * @since 1.5
 */
function sports_bench_do_team_stats_table( $html, $stats, $sport ) {
	if ( 'baseball' == $sport ) {
		if ( !empty( $stats ) ) {
			foreach ( $stats as $key => $row ) {
				$average[ $key ] = $row[ 'batting_average' ];
			}
			array_multisort( $average, SORT_DESC, $stats );
		}

		$html .= '';
		$html .= '';
		$table_head_styles = apply_filters( 'sports_bench_team_player_stats_head_row', '', $stats[ 0 ][ 'team_id' ] );
		$html .= '';
		$html .= '';
		$html .= '';
		$html .= '';
		$html .= '';
		$html .= '';
		$html .= '';
		$html .= '';
		$html .= '';
		$html .= '';
		$html .= '';
		$html .= '';
		$html .= '';
		$html .= '';
		$html .= '';
		$html .= '';
		foreach( $stats as $player ) {
			if ( $player[ 'at_bats' ] > 0 ) {
				$table_row_styles = apply_filters( 'sports_bench_team_player_stats_row', '', $stats[ 0 ][ 'team_id' ] );
				$html .= '';
				$html .= '';
				$html .= '';
				$html .= '';
				$html .= '';
				$html .= '';
				$html .= '';
				$html .= '';
				$html .= '';
				$html .= '';
				$html .= '';
				$html .= '';
				$html .= '';
				$html .= '';
			}
		}
		$html .= '';
		$html .= '
' . __( 'AB', 'sports-bench' ) . '' . __( 'AVG', 'sports-bench' ) . '' . __( 'H', 'sports-bench' ) . '' . __( 'R', 'sports-bench' ) . '' . __( 'RBI', 'sports-bench' ) . '' . __( '2B', 'sports-bench' ) . '' . __( '3B', 'sports-bench' ) . '' . __( 'HR', 'sports-bench' ) . '' . __( 'SO', 'sports-bench' ) . '' . __( 'BB', 'sports-bench' ) . '' . __( 'HBP', 'sports-bench' ) . '
' . $player[ 'player_name' ] . '' . $player[ 'at_bats' ] . '' . $player[ 'batting_average' ] . '' . $player[ 'hits' ] . '' . $player[ 'runs' ] . '' . $player[ 'rbi' ] . '' . $player[ 'doubles' ] . '' . $player[ 'triples' ] . '' . $player[ 'homeruns' ] . '' . $player[ 'strikeouts' ] . '' . $player[ 'walks' ] . '' . $player[ 'hit_by_pitch' ] . '
'; if ( !empty( $stats ) ) { foreach ( $stats as $key => $row ) { $era[ $key ] = $row[ 'era' ]; } array_multisort( $era, SORT_ASC, $stats ); } $html .= ''; $html .= ''; $table_head_styles = apply_filters( 'sports_bench_team_player_stats_head_row', '', $stats[ 0 ][ 'team_id' ] ); $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; foreach( $stats as $player ) { if ( $player[ 'pitch_count' ] > 0 ) { $table_row_styles = apply_filters( 'sports_bench_team_player_stats_row', '', $stats[ 0 ][ 'team_id' ] ); $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; } } $html .= ''; $html .= '
' . __( 'IP', 'sports-bench' ) . '' . __( 'ERA', 'sports-bench' ) . '' . __( 'R', 'sports-bench' ) . '' . __( 'ER', 'sports-bench' ) . '' . __( 'H', 'sports-bench' ) . '' . __( 'K', 'sports-bench' ) . '' . __( 'BB', 'sports-bench' ) . '' . __( 'HPB', 'sports-bench' ) . '' . __( 'HR', 'sports-bench' ) . '' . __( 'PC', 'sports-bench' ) . '
' . $player[ 'player_name' ] . '' . $player[ 'innings_pitched' ] . '' . $player[ 'era' ] . '' . $player[ 'runs_allowed' ] . '' . $player[ 'earned_runs' ] . '' . $player[ 'hits_allowed' ] . '' . $player[ 'pitcher_strikeouts' ] . '' . $player[ 'pitcher_walks' ] . '' . $player[ 'pitcher_hit_batters' ] . '' . $player[ 'homeruns_allowed' ] . '' . $player[ 'pitch_count' ] . '
'; $html .= '

' . sports_bench_show_stats_abbreviation_guide() . '

'; } elseif ( 'basketball' == $sport ) { $html .= ''; $html .= ''; $table_head_styles = apply_filters( 'sports_bench_team_player_stats_head_row', '', $stats[ 0 ][ 'team_id' ] ); $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $table_head_styles = apply_filters( 'sports_bench_team_player_stats_head_row', '', $stats[ 0 ][ 'team_id' ] ); $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; foreach( $stats as $player ) { if ( $player[ 'games_played' ] > 0 ) { if ( strlen( $player[ 'minutes' ] ) > 4 ) { $seconds = substr( $player[ 'minutes' ], -2, 2 ); $time = substr_replace( $player[ 'minutes' ], '', -2, 2 ); $minutes = substr( $time, -2, 2 ); $time = substr_replace( $time, '', -2, 2 ); $times = array( $time, $minutes, $seconds ); $time = implode( ':', $times ); } else { $seconds = substr( $player[ 'minutes' ], -2, 2 ); $minutes = substr_replace( $player[ 'minutes' ], '', -2, 2 ); $times = array( $minutes, $seconds ); $time = implode( ':', $times ); } $table_row_styles = apply_filters( 'sports_bench_team_player_stats_row', '', $stats[ 0 ][ 'team_id' ] ); $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; } } $html .= ''; $html .= '
' . __( 'REBOUNDS', 'sports-bench' ) . '
' . __( 'GP', 'sports-bench' ) . '' . __( 'ST', 'sports-bench' ) . '' . __( 'MIN', 'sports-bench' ) . '' . __( 'FG', 'sports-bench' ) . '' . __( '3-PT', 'sports-bench' ) . '' . __( 'FT', 'sports-bench' ) . '' . __( 'PTS', 'sports-bench' ) . '' . __( 'AVG', 'sports-bench' ) . '' . __( 'O-D', 'sports-bench' ) . '' . __( 'TOTAL', 'sports-bench' ) . '' . __( 'REB', 'sports-bench' ) . '' . __( 'A', 'sports-bench' ) . '' . __( 'S', 'sports-bench' ) . '' . __( 'B', 'sports-bench' ) . '' . __( 'TO', 'sports-bench' ) . '' . __( '+/-', 'sports-bench' ) . '
' . $player[ 'player_name' ] . '' . $player[ 'games_played' ] . '' . $player[ 'starts' ] . '' . $time . '' . $player[ 'fgm' ] . '-' . $player[ 'fga' ] . '' . $player[ '3pm' ] . '-' . $player[ '3pa' ] . '' . $player[ 'ftm' ] . '-' . $player[ 'fta' ] . '' . $player[ 'points' ] . '' . $player[ 'points_per_game' ] . '' . $player[ 'off_reb' ] . '-' . $player[ 'def_reb' ] . '' . $player[ 'tot_reb' ] . '' . $player[ 'assists' ] . '' . $player[ 'steals' ] . '' . $player[ 'blocks' ] . '' . $player[ 'to' ] . '' . $player[ 'plus_minus' ] . '
'; $html .= '

' . sports_bench_show_stats_abbreviation_guide() . '

'; } elseif ( 'football' == $sport ) { if ( !empty( $stats ) ) { foreach ( $stats as $key => $row ) { $passyards[ $key ] = $row[ 'pass_yards' ]; } array_multisort( $passyards, SORT_DESC, $stats ); } $html .= ''; $html .= ''; $table_head_styles = apply_filters( 'sports_bench_team_player_stats_head_row', '', $stats[ 0 ][ 'team_id' ] ); $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; foreach( $stats as $player ) { if ( $player[ 'attempts' ] > 0 ) { $table_row_styles = apply_filters( 'sports_bench_team_player_stats_row', '', $stats[ 0 ][ 'team_id' ] ); $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; } } $html .= ''; $html .= '
' . __( 'COMP', 'sports-bench' ) . '' . __( 'ATT', 'sports-bench' ) . '' . __( 'YARDS', 'sports-bench' ) . '' . __( 'TD', 'sports-bench' ) . '' . __( 'INT', 'sports-bench' ) . '
' . $player[ 'player_name' ] . '' . $player[ 'completions' ] . '' . $player[ 'attempts' ] . '' . $player[ 'pass_yards' ] . '' . $player[ 'pass_tds' ] . '' . $player[ 'pass_ints' ] . '
'; if ( !empty( $stats ) ) { foreach ( $stats as $key => $row ) { $rushyards[ $key ] = $row[ 'rush_yards' ]; $rushes[ $key ] = $row[ 'rushes' ]; } array_multisort( $rushyards, SORT_DESC, $rushes, SORT_DESC, $stats ); } $html .= ''; $html .= ''; $table_head_styles = apply_filters( 'sports_bench_team_player_stats_head_row', '', $stats[ 0 ][ 'team_id' ] ); $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; foreach( $stats as $player ) { if ( $player[ 'rushes' ] > 0 ) { $table_row_styles = apply_filters( 'sports_bench_team_player_stats_row', '', $stats[ 0 ][ 'team_id' ] ); $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; } } $html .= ''; $html .= '
' . __( 'RUSHES', 'sports-bench' ) . '' . __( 'YARDS', 'sports-bench' ) . '' . __( 'TDS', 'sports-bench' ) . '' . __( 'FUMBLES', 'sports-bench' ) . '
' . $player[ 'player_name' ] . '' . $player[ 'rushes' ] . '' . $player[ 'rush_yards' ] . '' . $player[ 'rush_tds' ] . '' . $player[ 'rush_fumbles' ] . '
'; if ( !empty( $stats ) ) { foreach ( $stats as $key => $row ) { $receiving_yards[ $key ] = $row[ 'receiving_yards' ]; $catches[ $key ] = $row[ 'catches' ]; } array_multisort( $receiving_yards, SORT_DESC, $catches, SORT_DESC, $stats ); } $html .= ''; $html .= ''; $table_head_styles = apply_filters( 'sports_bench_team_player_stats_head_row', '', $stats[ 0 ][ 'team_id' ] ); $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; foreach( $stats as $player ) { if ( $player[ 'catches' ] > 0 ) { $table_row_styles = apply_filters( 'sports_bench_team_player_stats__row', '', $stats[ 0 ][ 'team_id' ] ); $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; } } $html .= ''; $html .= '
' . __( 'CATCHES', 'sports-bench' ) . '' . __( 'YARDS', 'sports-bench' ) . '' . __( 'TDS', 'sports-bench' ) . '' . __( 'FUMBLES', 'sports-bench' ) . '
' . $player[ 'player_name' ] . '' . $player[ 'catches' ] . '' . $player[ 'receiving_yards' ] . '' . $player[ 'receiving_tds' ] . '' . $player[ 'receiving_fumbles' ] . '
'; if ( !empty( $stats ) ){ foreach ( $stats as $key => $row ) { $tackles[ $key ] = $row[ 'tackles' ]; $sacks[ $key ] = $row[ 'sacks' ]; $ints[ $key ] = $row[ 'ints' ]; $forced_fumbles[ $key ] = $row[ 'forced_fumbles' ]; $fumbles_recovered[ $key ] = $row[ 'fumbles_recovered' ]; $blocked[ $key ] = $row[ 'blocked' ]; $yards[ $key ] = $row[ 'yards' ]; } array_multisort( $tackles, SORT_DESC, $sacks, SORT_DESC, $ints, SORT_DESC, $forced_fumbles, SORT_DESC, $fumbles_recovered, SORT_DESC, $blocked, SORT_DESC, $yards, SORT_DESC, $stats ); } $html .= ''; $html .= ''; $table_head_styles = apply_filters( 'sports_bench_team_player_stats_head_row', '', $stats[ 0 ][ 'team_id' ] ); $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; foreach( $stats as $player ) { if ( $player[ 'tackles' ] > 0 or $player[ 'ints' ] > 0 or $player[ 'forced_fumbles' ] > 0 or $player[ 'fumbles_recovered' ] > 0 or $player[ 'blocked' ] > 0 ) { $table_row_styles = apply_filters( 'sports_bench_team_player_stats_row', '', $stats[ 0 ][ 'team_id' ] ); $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; } } $html .= ''; $html .= '
' . __( 'TCK', 'sports-bench' ) . '' . __( 'TFL', 'sports-bench' ) . '' . __( 'SACKS', 'sports-bench' ) . '' . __( 'INTS', 'sports-bench' ) . '' . __( 'TDS', 'sports-bench' ) . '' . __( 'FF', 'sports-bench' ) . '' . __( 'FR', 'sports-bench' ) . '' . __( 'BLK', 'sports-bench' ) . '' . __( 'YDS', 'sports-bench' ) . '
' . $player[ 'player_name' ] . '' . $player[ 'tackles' ] . '' . $player[ 'tfl' ] . '' . $player[ 'sacks' ] . '' . $player[ 'ints' ] . '' . $player[ 'tds' ] . '' . $player[ 'forced_fumbles' ] . '' . $player[ 'fumbles_recovered' ] . '' . $player[ 'blocked' ] . '' . $player[ 'yards' ] . '
'; if ( !empty( $stats ) ) { foreach ( $stats as $key => $row ) { $fga[ $key ] = $row[ 'fga' ]; $xpa[ $key ] = $row[ 'xpa' ]; } array_multisort( $fga, SORT_DESC, $xpa, SORT_DESC, $stats ); } $html .= ''; $html .= ''; $table_head_styles = apply_filters( 'sports_bench_team_player_stats_head_row', '', $stats[ 0 ][ 'team_id' ] ); $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; foreach( $stats as $player ) { if ( $player[ 'fga' ] > 0 or $player[ 'xpa' ] > 0 or $player[ 'touchbacks' ] > 0 ) { $table_row_styles = apply_filters( 'sports_bench_team_player_stats_row', '', $stats[ 0 ][ 'team_id' ] ); $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; } } $html .= ''; $html .= '
' . __( 'FGM', 'sports-bench' ) . '' . __( 'FGA', 'sports-bench' ) . '' . __( 'XPM', 'sports-bench' ) . '' . __( 'XPA', 'sports-bench' ) . '' . __( 'TOUCHBACKS', 'sports-bench' ) . '
' . $player[ 'player_name' ] . '' . $player[ 'fgm' ] . '' . $player[ 'fga' ] . '' . $player[ 'xpm' ] . '' . $player[ 'xpa' ] . '' . $player[ 'touchbacks' ] . '
'; if ( !empty( $stats ) ) { foreach ( $stats as $key => $row ) { $returnyards[ $key ] = $row[ 'return_yards' ]; $returns[ $key ] = $row[ 'returns' ]; } array_multisort( $returnyards, SORT_DESC, $returns, SORT_DESC, $stats ); } $html .= ''; $html .= ''; $table_head_styles = apply_filters( 'sports_bench_team_player_stats_head_row', '', $stats[ 0 ][ 'team_id' ] ); $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; foreach( $stats as $player ) { if ( $player[ 'returns' ] > 0 ) { $table_row_styles = apply_filters( 'sports_bench_team_player_stats_row', '', $stats[ 0 ][ 'team_id' ] ); $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; } } $html .= ''; $html .= '
' . __( 'RETURNS', 'sports-bench' ) . '' . __( 'YARDS', 'sports-bench' ) . '' . __( 'TDS', 'sports-bench' ) . '' . __( 'FUMBLES', 'sports-bench' ) . '
' . $player[ 'player_name' ] . '' . $player[ 'returns' ] . '' . $player[ 'return_yards' ] . '' . $player[ 'return_tds' ] . '' . $player[ 'return_fumbles' ] . '
'; $html .= '

' . sports_bench_show_stats_abbreviation_guide() . '

'; } elseif ( 'hockey' == $sport ) { $html .= ''; $html .= ''; $table_head_styles = apply_filters( 'sports_bench_team_player_stats_head_row', '', $stats[ 0 ][ 'team_id' ] ); $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; foreach( $stats as $player ) { if ( strlen( $player[ 'ice_time' ] ) > 4 ) { $seconds = substr( $player[ 'ice_time' ], -2, 2 ); $time = substr_replace( $player[ 'ice_time' ], '', -2, 2 ); $minutes = substr( $time, -2, 2 ); $time = substr_replace( $time, '', -2, 2 ); $times = array( $time, $minutes, $seconds ); $time = implode( ':', $times ); } else { $seconds = substr( $player[ 'ice_time' ], -2, 2 ); $minutes = substr_replace( $player[ 'ice_time' ], '', -2, 2 ); $times = array( $minutes, $seconds ); $time = implode( ':', $times ); } if ( $player[ 'shots_faced' ] <= 0 ) { $table_row_styles = apply_filters( 'sports_bench_team_player_stats_row', '', $stats[ 0 ][ 'team_id' ] ); $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; } } $html .= ''; $html .= '
' . __( 'G', 'sports-bench' ) . '' . __( 'A', 'sports-bench' ) . '' . __( 'PTS', 'sports-bench' ) . '' . __( '+/-', 'sports-bench' ) . '' . __( 'SOG', 'sports-bench' ) . '' . __( 'PEN', 'sports-bench' ) . '' . __( 'PM', 'sports-bench' ) . '' . __( 'H', 'sports-bench' ) . '' . __( 'SFT', 'sports-bench' ) . '' . __( 'TOI', 'sports-bench' ) . '' . __( 'FO-FW', 'sports-bench' ) . '
' . $player[ 'player_name' ] . '' . $player[ 'goals' ] . '' . $player[ 'assists' ] . '' . $player[ 'points' ] . '' . $player[ 'plus_minus' ] . '' . $player[ 'sog' ] . '' . $player[ 'penalties' ] . '' . $player[ 'pen_minutes' ] . '' . $player[ 'hits' ] . '' . $player[ 'shifts' ] . '' . $time . '' . $player[ 'faceoffs' ] . '-' . $player[ 'faceoff_wins' ] . '
'; $html .= ''; $html .= ''; $table_head_styles = apply_filters( 'sports_bench_team_player_stats_head_row', '', $stats[ 0 ][ 'team_id' ] ); $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; foreach( $stats as $player ) { if ( $player[ 'shots_faced' ] > 0 ) { $table_row_styles = apply_filters( 'sports_bench_team_player_stats_row', '', $stats[ 0 ][ 'team_id' ] ); $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; } } $html .= ''; $html .= '
' . __( 'SF', 'sports-bench' ) . '' . __( 'SAVES', 'sports-bench' ) . '' . __( 'GA', 'sports-bench' ) . '' . __( 'GAA', 'sports-bench' ) . '
' . $player[ 'player_name' ] . '' . $player[ 'shots_faced' ] . '' . $player[ 'saves' ] . '' . $player[ 'goals_allowed' ] . '' . $player[ 'goals_against_average' ] . '
'; $html .= '

' . sports_bench_show_stats_abbreviation_guide() . '

'; } elseif ( 'rugby' == $sport ) { $html .= ''; $html .= ''; $table_head_styles = apply_filters( 'sports_bench_team_player_stats_head_row', '', $stats[ 0 ][ 'team_id' ] ); $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; foreach( $stats as $player ) { if ( $player[ 'games_played' ] > 0 ) { $table_row_styles = apply_filters( 'sports_bench_team_player_stats_row', '', $stats[ 0 ][ 'team_id' ] ); $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; } } $html .= ''; $html .= '
' . __( 'GP', 'sports-bench' ) . '' . __( 'T', 'sports-bench' ) . '' . __( 'PT', 'sports-bench' ) . '' . __( 'A', 'sports-bench' ) . '' . __( 'C', 'sports-bench' ) . '' . __( 'PG', 'sports-bench' ) . '' . __( 'DK', 'sports-bench' ) . '' . __( 'PTS', 'sports-bench' ) . '' . __( 'PC', 'sports-bench' ) . '' . __( 'MR', 'sports-bench' ) . '' . __( 'R', 'sports-bench' ) . '' . __( 'Y', 'sports-bench' ) . '
' . $player[ 'player_name' ] . '' . $player[ 'games_played' ] . '' . $player[ 'tries' ] . '' . $player[ 'points' ] . '' . $player[ 'assists' ] . '' . $player[ 'conversions' ] . '' . $player[ 'pk_goals' ] . '' . $player[ 'drop_kicks' ] . '' . $player[ 'points' ] . '' . $player[ 'penalties_conceded' ] . '' . $player[ 'meters_run' ] . '' . $player[ 'red_cards' ] . '' . $player[ 'yellow_cards' ] . '
'; $html .= '

' . sports_bench_show_stats_abbreviation_guide() . '

'; } elseif ( 'soccer' == $sport ) { $html .= ''; $html .= ''; $table_head_styles = apply_filters( 'sports_bench_team_player_stats_head_row', '', $stats[ 0 ][ 'team_id' ] ); $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; foreach( $stats as $player ) { if ( $player[ 'shots_faced' ] <= 0 and $player[ 'minutes' ] > 0 ) { $table_row_styles = apply_filters( 'sports_bench_team_player_stats_row', '', $stats[ 0 ][ 'team_id' ] ); $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; } } $html .= ''; $html .= '
' . __( 'MIN', 'sports-bench' ) . '' . __( 'G', 'sports-bench' ) . '' . __( 'A', 'sports-bench' ) . '' . __( 'SH', 'sports-bench' ) . '' . __( 'SOG', 'sports-bench' ) . '' . __( 'F', 'sports-bench' ) . '' . __( 'FS', 'sports-bench' ) . '
' . $player[ 'player_name' ] . '' . $player[ 'minutes' ] . '' . $player[ 'goals' ] . '' . $player[ 'assists' ] . '' . $player[ 'shots' ] . '' . $player[ 'sog' ] . '' . $player[ 'fouls' ] . '' . $player[ 'fouls_suffered' ] . '
'; $html .= ''; $html .= ''; $table_head_styles = apply_filters( 'sports_bench_team_player_stats_head_row', '', $stats[ 0 ][ 'team_id' ] ); $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; foreach( $stats as $player ) { if ( $player[ 'shots_faced' ] > 0 ) { $table_row_styles = apply_filters( 'sports_bench_team_player_stats_row', '', $stats[ 0 ][ 'team_id' ] ); $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; } } $html .= ''; $html .= '
' . __( 'MIN', 'sports-bench' ) . '' . __( 'SF', 'sports-bench' ) . '' . __( 'SV', 'sports-bench' ) . '' . __( 'GA', 'sports-bench' ) . '' . __( 'GAA', 'sports-bench' ) . '
' . $player[ 'player_name' ] . '' . $player[ 'minutes' ] . '' . $player[ 'shots_faced' ] . '' . $player[ 'shots_saved' ] . '' . $player[ 'goals_allowed' ] . '' . $player[ 'goals_against_average' ] . '
'; $html .= '

' . sports_bench_show_stats_abbreviation_guide() . '

'; } elseif ( 'volleyball' == $sport ) { $html .= ''; $html .= ''; $table_head_styles = apply_filters( 'sports_bench_team_player_stats_head_row', '', $stats[ 0 ][ 'team_id' ] ); $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; foreach( $stats as $player ) { if ( $player[ 'games_played' ] > 0 ) { $table_row_styles = apply_filters( 'sports_bench_team_player_stats_row', '', $stats[ 0 ][ 'team_id' ] ); $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; } } $html .= ''; $html .= '
' . __( 'GP', 'sports-bench' ) . '' . __( 'SP', 'sports-bench' ) . '' . __( 'PTS', 'sports-bench' ) . '' . __( 'HIT %', 'sports-bench' ) . '' . __( 'K', 'sports-bench' ) . '' . __( 'ATT', 'sports-bench' ) . '' . __( 'HE', 'sports-bench' ) . '' . __( 'SET E', 'sports-bench' ) . '' . __( 'SET A', 'sports-bench' ) . '' . __( 'S', 'sports-bench' ) . '' . __( 'SE', 'sports-bench' ) . '' . __( 'ACE', 'sports-bench' ) . '' . __( 'B', 'sports-bench' ) . '' . __( 'BA', 'sports-bench' ) . '' . __( 'BE', 'sports-bench' ) . '' . __( 'DIG', 'sports-bench' ) . '' . __( 'RE', 'sports-bench' ) . '
' . $player[ 'player_name' ] . '' . $player[ 'games_played' ] . '' . $player[ 'sets_played' ] . '' . $player[ 'points' ] . '' . $player[ 'hitting_percent' ] . '' . $player[ 'kills' ] . '' . $player[ 'attacks' ] . '' . $player[ 'hitting_errors' ] . '' . $player[ 'set_errors' ] . '' . $player[ 'set_attempts' ] . '' . $player[ 'serves' ] . '' . $player[ 'serve_errors' ] . '' . $player[ 'aces' ] . '' . $player[ 'blocks' ] . '' . $player[ 'block_attempts' ] . '' . $player[ 'block_errors' ] . '' . $player[ 'digs' ] . '' . $player[ 'rec_errors' ] . '
'; $html .= '

' . sports_bench_show_stats_abbreviation_guide() . '

'; } else { } return $html; } add_filter( 'sports_bench_team_stats_table', 'sports_bench_do_team_stats_table', 10, 4 );