Skip to content

Instantly share code, notes, and snippets.

@ultimatemember
Last active May 30, 2024 18:03
Show Gist options
  • Save ultimatemember/f7eab149cb33df735b08 to your computer and use it in GitHub Desktop.
Save ultimatemember/f7eab149cb33df735b08 to your computer and use it in GitHub Desktop.
Extend Ultimate Member Account page with custom tabs/content
/* add new tab called "mytab" */
add_filter('um_account_page_default_tabs_hook', 'my_custom_tab_in_um', 100 );
function my_custom_tab_in_um( $tabs ) {
$tabs[800]['mytab']['icon'] = 'um-faicon-pencil';
$tabs[800]['mytab']['title'] = 'My Custom Tab';
$tabs[800]['mytab']['custom'] = true;
return $tabs;
}
/* make our new tab hookable */
add_action('um_account_tab__mytab', 'um_account_tab__mytab');
function um_account_tab__mytab( $info ) {
global $ultimatemember;
extract( $info );
$output = $ultimatemember->account->get_tab_output('mytab');
if ( $output ) { echo $output; }
}
/* Finally we add some content in the tab */
add_filter('um_account_content_hook_mytab', 'um_account_content_hook_mytab');
function um_account_content_hook_mytab( $output ){
ob_start();
?>
<div class="um-field">
<!-- Here goes your custom content -->
</div>
<?php
$output .= ob_get_contents();
ob_end_clean();
return $output;
}
@ogdesigns
Copy link

Hello @hemnathmouli @Ferdinand1945 @hirenshah @ghmercado @jkester1986 and everyone... Please how do i disable the button that is automatically added to the new custom account tab?
Image here >> https://ibb.co/RvXLMFv

@NorbertKrupa
Copy link

Is there a way to return the user to their account page after saving details from a custom tab? It currently gives a 404 when it tries to return to the custom tab.

@crestsphere
Copy link

crestsphere commented Nov 30, 2022

How do I integrate zoom online meeting platform with UM plugin?
Thanks in advance.

@melwong
Copy link

melwong commented Apr 30, 2023

Could we add a submenu within the custom tab? A sub-custom tab that is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment