apply_filters( 'sports_bench_before_player_shortcode', $html, $player )

Type

Filters

Section

Players

Outputs the HTML for before the player shortcode

Parameters

  • $html, string, the current HTML for before the player shortcode
  • $player, Sports_Bench_Player object, the player object for the selected player

Returns

  • string, the HTML to be outputted before the player shortcode

Since: 1.5

Source: shortcodes.php, line 97

Example

/**
 * Returns the html for the div for the top part of the player shortcode
 *
 * @param $html, current html for the section
 *
 * @param $player, the Player Class for the player
 *
 * @return string, html for the div
 */
function sports_bench_player_shortcode_head( $html, $player ) {
    if ( 0 < $player->team_id ) {
        $team = new Sports_Bench_Team( (int)$player->team_id );
    } else {
        $team = 0;
    }

    if ( 0 !== $team ) {
        $html .= '
'; } else { $html .= '
'; } return $html; } add_filter( 'sports_bench_before_player_shortcode', 'sports_bench_player_shortcode_head', 10, 2 );