apply_filters( 'sports_bench_team_roster_table', $html, $players, $team_id )

Type

Filters

Section

Teams

Outputs the table for the team’s roster

Parameters

  • $html, string, the current HTML for the table
  • $players, array, the players and their information that are on the team
  • $team_id, integer, the team id for the team

Returns

  • string, the HTML for the roster table

Since: 1.5

Source: team-functions.php, line 100

Example

/**
 * Returns the html for the team's roster table
 *
 * @param string $html
 *
 * @param array $players
 *
 * @param int $team_id
 *
 * @return string, html for the roster table
 *
 * @since 1.5
 */
function sports_bench_do_team_roster_table( $html, $players, $team_id ) {
	$html .= '';
	$html .= '';
	$table_head_styles = apply_filters( 'sports_bench_team_roster_head_row', '', $team_id );
	$html .= '';
	$html .= '';
	$html .= '';
	$html .= '';
	$html .= '';
	$html .= '';
	$html .= '';
	$html .= '';
	$html .= '';
	$html .= '';
	foreach ( $players as $player ) {
		$table_row_styles = apply_filters( 'sports_bench_team_roster_player_row', '', $team_id );
		$html .= '';
		$html .= '';
		$html .= '';
		$html .= '';
		$html .= '';
		$html .= '';
		$html .= '';
		$html .= '';
	}
	$html .= '';
	$html .= '
' . __( 'Player', 'sports-bench' ) . '' . __( 'Position', 'sports-bench' ) . '' . __( 'Hometown', 'sports-bench' ) . '' . __( 'Height', 'sports-bench' ) . '' . __( 'Weight', 'sports-bench' ) . '' . __( 'Age', 'sports-bench' ) . '
' . $player[ 'first_name' ] . ' ' . $player[ 'last_name' ] . '' . $player[ 'position' ] . '' . $player[ 'home_city' ] . ', ' . $player[ 'home_state' ] . '' . stripslashes( $player[ 'height' ] ) . '' . $player[ 'weight' ] . '' . $player[ 'age' ] . '
'; return $html; } add_filter( 'sports_bench_team_roster_table', 'sports_bench_do_team_roster_table', 10, 3 );