Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save loorlab/d5e0b16698b724d175780839e4588825 to your computer and use it in GitHub Desktop.
Save loorlab/d5e0b16698b724d175780839e4588825 to your computer and use it in GitHub Desktop.
Multiple Tabs Account - Ultimate Member - WordPress via https://wordpress.org/support/topic/customize-account-page/
<?php
// functions.php
// ACCOUNT TAB 1
add_filter(‘um_account_page_default_tabs_hook’, ‘my_custom_tab_in_um’, 100 );
function my_custom_tab_in_um( $tabs ) {
$tabs[800][‘tab1’][‘icon’] = ‘um-faicon-arrow-circle-o-down’;
$tabs[800][‘tab1’][‘title’] = ‘Tab 1’;
$tabs[800][‘tab1’][‘custom’] = true;
return $tabs;
}
add_action(‘um_account_tab__tab1’, ‘um_account_tab__tab1’);
function um_account_tab__tab1( $info ) {
global $ultimatemember;
extract( $info );
$output = $ultimatemember->account->get_tab_output(‘tab1’);
if ( $output ) { echo $output; }
}
add_filter(‘um_account_content_hook_tab1’, ‘um_account_content_hook_tab1’);
function um_account_content_hook_tab1( $output ){
ob_start();
?>
<div class=”um-field”>
page or shortcode or content here.
</div>
<?php
$output .= ob_get_contents();
ob_end_clean();
return $output;
}
// ACCOUNT TAB 2
add_filter(‘um_account_page_default_tabs_hook’, ‘my_custom_tab_in_um2’, 100 );
function my_custom_tab_in_um2( $tabs ) {
$tabs[800][‘tab2’][‘icon’] = ‘um-faicon-pencil’;
$tabs[800][‘tab2’][‘title’] = ‘Tab2’;
$tabs[800][‘tab2’][‘custom’] = true;
return $tabs;
}
add_action(‘um_account_tab__tab2’, ‘um_account_tab__tab2’);
function um_account_tab__tab2( $info ) {
global $ultimatemember;
extract( $info );
$output = $ultimatemember->account->get_tab_output(‘Tab 2’);
if ( $output ) { echo $output; }
}
add_filter(‘um_account_content_hook_tab2’, ‘um_account_content_hook_tab2’);
function um_account_content_hook_tab2( $output ){
ob_start();
?>
<div class=”um-field”>
page or shortcode or content here.
</div>
<?php
$output .= ob_get_contents();
ob_end_clean();
return $output;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment