Player Profile Social Icons

Player Profile Social Icons

In the version 3.16 update, we introduced the ability to filter social icons in player profiles. Social icons are the linkable icons that appear in the screenshot below:

Steam icon available after snippet.

By default, Tournamatch supports Facebook, Homepage, Twitch, Twitter, and YouTube. These social icon fields appear as configurable options to your users when he or she edits their player profile:

You may modify the social icons available to your users by adding extending Tournamatch with custom code which filters the default list. Filtering this list is easy, and you should read how to extend a plugin in WordPress if you have never done so before.

A social icon in Tournamatch requires three fields: display_name, icon, and input_type. The display_name is the pretty name displayed to the user when editing his or her profile, the icon field is the name of the FontAwesome icon which will be displayed linkable in the public profile, and the input_type is text. You can look up any applicable social media icon on this page under the brand section.

In the screenshot below, the sample code adds the social media icons Instagram and Steam to the default list. Pay special attention to the function array_merge. Using this adds your icons to the list of defaults already given.

Custom Player Profile Social Icons Code

Add a filter for ‘trn_player_social_icon_fields’ to modify the social icons displayed to the user.

Share this post

Leave a Reply

Your email address will not be published. Required fields are marked *