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. Check out our How to Extend a Plugin in WordPress with a Filter Hook blog post for helping extending this example.

function my_player_fields( $fields ) {
        $data = 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