Documentation
Team Fields
Description
Filters the list of fields for a team. Fields are displayed at the top of team profiles. A user may edit the field by editing his or her team's profile.
Usage
function my_team_fields( $fields ) {
# ....
}
add_filter( 'trn_team_fields', 'my_team_fields' );
Parameters
fields
- (array)(required) Associative array of fields to display.
Examples
The following sample code adds a Discord field to team profiles. Check out our How to Extend a Plugin in WordPress with a Filter Hook blog post for helping extending this example.
function my_team_fields( $fields ) {
$data = array(
'discord' => array(
'display_name' => 'Discord',
'input_type' => 'text'
),
);
return array_merge( $fields, $data );
}
add_filter( 'trn_team_fields', 'my_team_fields' );
Changelog
Version | Description |
---|---|
3.22.0 | Introduced |