Customize Account Page
-
Hello,
I know that i can use this code to add a menu in account page :
/* 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;
}This is working well.
But when i want to add a second menu using same code (but changing tab name), i’ve a blank account page…something don’t work./* add new tab called “mytab2″ */
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-faicon-pencil’;
$tabs[800][‘mytab2’][‘title’] = ‘My Custom Tab 2’;
$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”>
<!– Here goes your custom content –>
</div>
<?php
$output .= ob_get_contents();
ob_end_clean();
return $output;
}What do i need to change else ?
I’ve try changing this ‘$tabs[800]’ to ‘$tabs[900]’ but it’s not working too…Please help.
- The topic ‘Customize Account Page’ is closed to new replies.