apply_filters( 'sports_bench_player_listing_information', $html, $player, $team, $num_players, $count )

Type

Filters

Section

Players

Outputs the HTML for the player information on the player listing page

Parameters

  • $html, string, current HTML being outputted
  • $player, Sports_Bench_Player object, the player object for the current player
  • $team, Sports_Bench_Team object, the team object for the current team
  • $num_players, integer, the number of total players on the given team
  • $count, integer, the current count of players being looped through

Returns

  • string, the HTML for the player listing

Since: 1.5

Source: player-functions.php, line 32

Example

/**
 * Returns html for the a player on the players listing page
 *
 * @param $html, current information for the player
 *
 * @param $player, the Player Class for the current player
 *
 * @param $team, the Team Class for the current player's team
 *
 * @param $num_players, the total number of players
 *
 * @param $count, the current count of players
 *
 * @return string. html for the player
 *
 * @since 1.5
*/
function sports_bench_player_listing_details( $html, $player, $team, $num_players, $count ) {
    if ( 0 == $count ) {
        $html .= '
'; } $html .= apply_filters( 'sports_bench_before_player_info', '', $team ); $html .= '
'; $html .= ''; $html .= '
'; $html .= apply_filters( 'sports_bench_after_player_info', '', $team ); if ( $num_players - 1 == $count ) { $html .= '
'; } return $html; } remove_filter( 'sports_bench_player_listing_information', 'sports_bench_do_player_listing_information' ); add_filter( 'sports_bench_player_listing_information', 'sports_bench_player_listing_details', 10, 5 );