Problems with extending account page with custom tab
-
Hi guys,
I’ve still got following problem:
I’d like to extend the account page with a custom tab. So I put this code in my functions.php (it’s 1:1 from UM page https://docs.ultimatemember.com/article/65-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; }
Funny fact: In the content there appears a button with the name of the tab which I can’t edit or remove.
So please tell me how to remove it because it’s senseless to have a button there I can’t edit.
Thanks a lot in advance.
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Problems with extending account page with custom tab’ is closed to new replies.