Custom Account Tab Link
-
I have found plenty of documentation on how to create a custom account tab with content (not to be confused with the profile tabs); however, I am finding nothing on how to make a custom account tab linkable without content. I just want the tab to link to another page on the site. I have found other people have asked the same question and nobody can figure it out.
Below is the code for adding content; perhaps someone can guide me on how to convert it to be linkable? Or provide another hook that I am not finding? Thanks in advance.
/* 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-book'; $tabs[800]['mytab']['title'] = 'My Courses'; $tabs[800]['mytab']['custom'] = true; $tabs[800]['mytab']['show_button'] = false; 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; }
- The topic ‘Custom Account Tab Link’ is closed to new replies.