Documentation

Player Social Icons

Description

Filters the list of social icons displayed for a player. Social icons should be Font-Awesome 5 icons. When a user enters a value for a corresponding social icon, it appears in the player's list and that player's profile page.

Usage

function my_player_social_icon_fields( $social_fields ) {
    # ....
}
add_filter( 'trn_player_social_icon_fields', 'my_player_social_icon_fields' );

Parameters

social_fields
(array)(required) Associative array of icons to display.

Examples

The following sample code adds a Steam social icon to player profiles. Check out our How to Extend a Plugin in WordPress with a Filter Hook blog post for helping extending this example.

function my_player_social_icon_fields( $social_fields) {
    $data = array(
        'steam' => array(
            'display_name' => 'Steam',
            'input_type' => 'text',
            'icon' => 'fab fa-steam',
        ),
    );

    return array_merge( $social_fields, $data );
}
add_filter( 'trn_player_social_icon_fields', 'my_player_social_icon_fields' );

Changelog

Version Description
3.18.0 FontAwesome upgraded to 5
3.16.0 Introduced