PressTigers

Using WordPress Filter to Add Custom Fields in User Profile

By default, in the WordPress user Profile section, under Contact information, there aren’t any extensive fields. However, you can add extra profile fields like links to different social media profiles and still include all the default fields (for example Email and Website) from the back-end.

This can be done simply using the WordPress filter: user_contactmethods.

You can bind your function with this filter, add the contact info fields you want in an array and simply return that array. Those fields will be added to the user profile contact info section. A sample code is given below:

 

User Comments

Leave a Reply

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

Get in Touch