Documentation

Player Fields

Description

Filters the list of fields for a player. Fields are displayed at the top of player profiles. A user may edit the field by editing his or her player profile.

Usage

function my_player_fields( $fields ) {
    # ....
}
add_filter( 'trn_player_fields', 'my_player_fields' );

Parameters

fields
(array)(required) Associative array of fields to display.

Examples

The following sample code adds a Gamer Tag field to player profiles.

function my_player_fields( $fields ) {
        $fields = array(
            'gamer_tag' => array(
                'display_name' => 'Gamer Tag',
                'input_type'   => 'text'
            ),
        );

    return array_merge( $fields, $data );
}
add_filter( 'trn_player_fields', 'my_player_fields' );

Changelog

Version Description
3.16.0 Introduced