Display a tab in the Account Page,Visible only to the owner with a specific role
-
I have added an extra tab on the Account Page and I want to disable that tab for some users (role)
Here is the code I have used :
add_filter('um_account_page_default_tabs_hook', 'my_custom_tab_in_um2', 100 ); function my_custom_tab_in_um2( $tabs ) { $tabs[800]['mytab2']['icon'] = 'um-icon-bookmark'; $tabs[800]['mytab2']['title'] = 'Submit Resume'; $tabs[800]['mytab2']['custom'] = true; return $tabs; } /* make our new tab hookable */ add_action('um_account_tab__mytab2', 'um_account_tab__mytab2'); function um_account_tab__mytab2( $info ) { global $ultimatemember; extract( $info ); $output = $ultimatemember->account->get_tab_output('mytab2'); if ( $output ) { echo $output; } } /* Finally we add some content in the tab */ add_filter('um_account_content_hook_mytab2', 'um_account_content_hook_mytab2'); function um_account_content_hook_mytab2( $output ){ ob_start(); ?> <div class="um-field"> <?php echo do_shortcode('[submit_resume_form]'); ?> </div> <?php $output .= ob_get_contents(); ob_end_clean(); return $output; }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Display a tab in the Account Page,Visible only to the owner with a specific role’ is closed to new replies.