How to display custom fields in Account
How to add custom account tab
The account menu can be extended with extra tab and fields using a custom code. See example below. The code is based on these hooks:
um_account_page_default_tabs_hook
- this hook is used to modify and extend the account menu.um_account_content_hook_{$tab_id}
- this hook is used to display content for the desired tab, where{$tab_id}
is the tab key in the$tabs
array.um_submit_account_errors_hook
- this hook is used to validate custom fields.um_after_user_account_updated
- this hook is used to update custom fields.
Code example
This code adds the 'custom_tab_01' tab with fields 'um_pet', 'um_colors', 'um_multi_select'. You can add your own tabs and fields. Add this code to the functions.php file in the active theme directory. Skip the opening <?php
tag.
NOTE: We have created this code example to provide guidance and to make it easier for you to implement this code into your website. However, we are not able to provide any support when it comes to customizing the plugin. If you need help implementing this code, please hire a developer.
Screenshots
Image - View a custom account tab.
Image - Error on the custom account tab submit.
Image - Success on the custom account tab submit.
You can use a free extension Ultimate Member - Account tabs to display more fields in Account. This extension can embed a profile form into the custom account tab.