apply_filters( 'sports_bench_team_info', $html, $team )

Type

Filters

Section

Teams

Outputs the HTML for the team information

Parameters

  • $html, string, the current HTML for the team listing
  • $team, Sports_Bench_Team object, the team object for the current team

Returns

  • string, the HTML for the team information

Since: 1.5

Source: team-functions.php, line 239

Example

/**
 * Returns the HTML for the team info section of the team page
 *
 * @param $html, current html for the team info section
 *
 * @param $team, the Team Class for the current team
 *
 * @return string, html for the team info section
 *
 * @since 1.5
 */
function sports_bench_team_info_page( $html, $team ) {
	$html .= '
'; $html .= $team->get_team_photo( 'team-logo' ); $html .= '
'; $address = ''; if ( $team->team_location_line_one ) { $address .= $team->team_location_line_one . ', '; } if ( $team->team_location_line_two ) { $address .= $team->team_location_line_two . ', '; } if ( $team->team_city ) { $address .= $team->team_city . ', '; } if ( $team->team_state ) { $address .= $team->team_state . ' '; } if ( $team->team_location_country ) { $address .= $team->team_location_country . ' '; } if ( $team->team_location_zip_code ) { $address .= $team->team_location_zip_code . ' '; } $team_record = $team->get_alltime_record(); $record = $team_record[0] . '—' . $team_record[2] . '—' . $team_record[1]; $html .= '

'; $html .= stripslashes( $team->team_stadium ) . '
'; $html .= $address . '
'; $html .= __( 'Head Coach', 'sports-bench' ) . ' ' . $team->team_head_coach . '
'; $html .= __( 'Years:' ) . ' ' . $team->get_years() . '
'; $html .= __( 'All-Time Record:' ) . ' ' . $record . '
'; $html .= '

'; return $html; } remove_filter( 'sports_bench_team_info', 'sports_bench_do_team_info' ); add_filter( 'sports_bench_team_info', 'sports_bench_team_info_page', 10, 2 );