/* First we need to extend main profile tabs */ | |
add_filter('um_profile_tabs', 'add_custom_profile_tab', 1000 ); | |
function add_custom_profile_tab( $tabs ) { | |
$tabs['mycustomtab'] = array( | |
'name' => 'My custom tab', | |
'icon' => 'um-faicon-comments', | |
); | |
return $tabs; | |
} | |
/* Then we just have to add content to that tab using this action */ | |
add_action('um_profile_content_mycustomtab_default', 'um_profile_content_mycustomtab_default'); | |
function um_profile_content_mycustomtab_default( $args ) { | |
echo 'Hello world!'; | |
} |
This comment has been minimized.
This comment has been minimized.
Antviss
commented
Nov 22, 2015
@peteratomic You need to change "mycustomtab" wherever it appears in the code above. E.G.: add_action('um_profile_content_mycustomtabdefault', 'um_profile_contentmycustomtabdefault'); |
This comment has been minimized.
This comment has been minimized.
eyaal
commented
Nov 27, 2015
Hello, Regards, |
This comment has been minimized.
This comment has been minimized.
tajbarr
commented
Feb 11, 2016
I have added 5 custom tabs but now want to add in some custom Ultimate Member Forms how would I do this in the content space, add_action('um_profile_content_tab1_default', 'um_profile_content_tab1_default'); |
This comment has been minimized.
This comment has been minimized.
sharma-ji
commented
Mar 1, 2016
Do I have to create a new file and write this code or I have write this in um-profile.php in templates folder? I am new to this please help me!! |
This comment has been minimized.
This comment has been minimized.
annalisalupo
commented
Mar 14, 2016
Do I have to create a new file and write this code or I have write this in um-profile.php in templates folder? I am new to this please help me!! |
This comment has been minimized.
This comment has been minimized.
Psychopomp777
commented
Apr 17, 2016
Hi,
|
This comment has been minimized.
This comment has been minimized.
zeecom
commented
Apr 21, 2016
Hello, I've used code from this example: Now I'm using this example:
to this:
Thanks! |
This comment has been minimized.
This comment has been minimized.
jakeols
commented
Sep 21, 2016
•
Tab is disappearing when I change it from anything other than 'mycustomtab', similar to what @peteratomic reported. I changed all references where mycustomtab was called. Is this expected behavior? Edit: apparently de-activating and reactivating plugin fixes this problem.. |
This comment has been minimized.
This comment has been minimized.
MalTarDesigns
commented
Sep 22, 2016
|
This comment has been minimized.
This comment has been minimized.
abdokouta
commented
Sep 29, 2016
is there anyone can help me with where exactly i would add that code, please?? |
This comment has been minimized.
This comment has been minimized.
h4m1dreza
commented
Oct 25, 2016
@tajbarr Could you tell me how you made 5 custom tabs? Did you change the code or just paste it 5 times? anyone knows how to make more than 1 tabs? |
This comment has been minimized.
This comment has been minimized.
elias1435
commented
May 23, 2017
•
Hello, /* add new tab called "mytab" */ add_filter('um_account_page_default_tabs_hook', 'my_custom_tab_in_um', 100 ); /* make our new tab hookable */ add_action('um_account_tab__makeedit', 'um_account_tab__makeedit');
} /* Finally we add some content in the tab */ add_filter('um_account_content_hook_makeedit', 'um_account_content_hook_makeedit');
|
This comment has been minimized.
This comment has been minimized.
eminsafa
commented
Jun 13, 2017
You put this code into your function.php file. Also it is possible to use child themes' functions.php file. |
This comment has been minimized.
This comment has been minimized.
eminsafa
commented
Jun 13, 2017
•
By the way you can add one more tab with these codes:
|
This comment has been minimized.
This comment has been minimized.
huzanspenta
commented
Jul 3, 2017
Hi, |
This comment has been minimized.
This comment has been minimized.
Carlvic
commented
Jul 16, 2017
•
Hello! How can I add upload field on my custom tab? I use this code but it's all blank ` add_filter('um_account_content_hook_mytab', 'um_account_content_hook_mytab');
} |
This comment has been minimized.
This comment has been minimized.
akblissweb
commented
Aug 2, 2017
Great examples above but all I would like to do is change the "Posts" tab title to the name of my custom post type "Ratings". I've already got the code to bring in the Ratings. I've searched everywhere and haven't seen any examples of how to change the titles of the existing tabs. |
This comment has been minimized.
This comment has been minimized.
MvdO
commented
Aug 3, 2017
I also need a code example to just change the existing tab names/slugs (Posts,Comments), anyone? |
This comment has been minimized.
This comment has been minimized.
maddyBoy
commented
Sep 18, 2017
// i am trying to create a custom tab as below /* First we need to extend main profile tabs */ add_filter('um_profile_tabs', 'add_custom_profile_tab', 1000 );
} /* Then we just have to add content to that tab using this action */ add_action('um_profile_content_createevent_default', 'um_profile_content_createevent_default'); } Problem: Tab disappeared as i replaced mycustomtab to createevent ?? |
This comment has been minimized.
This comment has been minimized.
Garconis
commented
Dec 1, 2017
Does this still work in version 2.0? I can't get this to work. |
This comment has been minimized.
This comment has been minimized.
Rajchicken
commented
Jan 22, 2018
Hi Guys! Thanks to your comments I have been playing around with the code also but with limited success. I am no developer but at least I was able to add more tabs using the function php file. Now my problem is the following: I believe i need to make some changes in the last bit of code and add smth like <a href=“URL"> but I am not 100% sure and would appreciate help! Thank you!! I used this code from "eminsafa" example add_filter('um_profile_tabs', 'add_custom_profile_tab', 1000 );
} add_action('um_profile_content_mycustomtab_default', 'um_profile_content_mycustomtab_default');
|
This comment has been minimized.
This comment has been minimized.
champsupertramp
commented
Jul 17, 2018
•
Hi Everyone, The code still works in You need to turn on the profile tab in It is turned off by default. Regards, |
This comment has been minimized.
This comment has been minimized.
amponsah
commented
Jul 20, 2018
Here is the full code to add multiple custom tabs to UM.2.0 - this is put together from the above comments: /* ------------------------------------------------------------------/
} // tab1 actions // tab2 actions function um_profile_content_arrival_info_default ( $args ) { // THIS GOES IN functions.php Thanks for all the commenst above. |
This comment has been minimized.
This comment has been minimized.
gwmbox
commented
Oct 7, 2018
How do I order the default tabs and the two new added tabs in the example code? |
This comment has been minimized.
This comment has been minimized.
dreaddy
commented
Dec 12, 2018
•
Just tried it and it was not working for me.
|
This comment has been minimized.
This comment has been minimized.
AlfredWest
commented
Jan 16, 2019
•
THis seems to work well in basis, but I m having a hard time implementing it the way I would like to. What I would like to do is to output various profile fields in the tab window. On the other hand if I try to display another short code created by wpforms that works fine. Is there another way to show Ultimate Member profile fields in the created tab? Here is what I have in there now: // BEGIN ADD PROFILE TABS add_filter('um_profile_tabs', 'add_custom_profile_tab', 1000 );
} /* Then we just have to add content to that tab using this action */ add_action('um_profile_content_mycustomtab_default', 'um_profile_content_mycustomtab_default'); |
This comment has been minimized.
This comment has been minimized.
inversi
commented
Jun 19, 2019
This comment has been minimized.
This comment has been minimized.
nikitasinelnikov
commented
Jul 19, 2019
Hi there, Since 2.0.53 version we support Profile Tabs privacy settings for all tabs and 'custom' attribute for custom tabs is deprecated. Instead of this, you could set default privacy for your custom tab. So after the adding of profile tabs, please update your Profile Tabs privacy settings here UM->Settings->Appearances->Profile Menu https://www.screencast.com/t/n2q7MQDoplg This code still works // Filter // Action Thanks! |
This comment has been minimized.
This comment has been minimized.
rajb686
commented
Sep 8, 2019
thanks @nikitasinelnikov where exactly do we add these lines of code? |
This comment has been minimized.
This comment has been minimized.
nikitasinelnikov
commented
Sep 9, 2019
hi @rajb686 You could add these lines in your theme or child-theme. Also, you may create your own plugin with all custom solutions at your site and paste these code lines in this plugin. I recommend inserting these lines to child-theme. Thanks! |
This comment has been minimized.
This comment has been minimized.
dbjpanda
commented
Sep 21, 2019
•
The one which works.
|
This comment has been minimized.
This comment has been minimized.
CoachAIng
commented
Oct 31, 2019
I've got custom tabs added ok, and are now looking at adding content within those tabs. I can add text in using echo, or a shortcode or a re-direct from the code snippets above. What i'm trying to do is embed a different pre-existing page within the new custom tab, so that it will display there without me having to hard code it into the function.php file. I think i'm just missing the right syntax to be able to do this? |
This comment has been minimized.
peteratomic commentedSep 10, 2015
Anyway to change "mycustomtab" in the URL ?profiletab=mycustomtab?
I tried changing it in the code but the tab disappeared afterwards.