• Resolved battuber

    (@battuber)


    Hello i create a custom tab with this code in doc of the plugin
    In the content there is a button that when click redirect to another page, sometimes when click in the button appears a message with account update, i want to remove the account update inside this tab

    /* 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[000]['mytab']['icon'] = 'um-faicon-pencil';
    	$tabs[000]['mytab']['title'] = 'My Custom Tab';
    	$tabs[000]['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">
    		
    		<button>click</button>
    		
    	</div>		
    		
    	<?php
    		
    	$output .= ob_get_contents();
    	ob_end_clean();
    	return $output;
    }
    • This topic was modified 4 years, 2 months ago by battuber.
    • This topic was modified 4 years, 2 months ago by battuber.
    • This topic was modified 4 years, 2 months ago by battuber.
Viewing 10 replies - 1 through 10 (of 10 total)
  • @battuber

    You can add to your function my_custom_tab_in_um : $tabs[000]['mytab']['show_button'] = false;

    • This reply was modified 4 years, 2 months ago by missveronica.
    Thread Starter battuber

    (@battuber)

    Hello there is a error message when I click in the button now

    @battuber

    Please, use the CODE formatting when posting php code in the Forum.

    Thread Starter battuber

    (@battuber)

    There is a way to remove the conflict with my button and update account button because when I click in my button the update account appears and the page refresh

    @battuber

    Try to remove all the code in the section “/* make our new tab hookable */”

    Thread Starter battuber

    (@battuber)

    I remove the code and when i clik in the button this message appears An error has been encountered sometimes the message dont appears

    @battuber

    Yes, because you have nothing to process and take action in your form.

    Thread Starter battuber

    (@battuber)

    How can i fix it

    Plugin Support Ultimate Member Support

    (@ultimatemembersupport)

    Hi @battuber

    Sorry for the late response. You can try adding this code snippet:

    
    if( isset( $_REQUEST['_um_account_tab'] )  && "mytab" === $_REQUEST['_um_account_tab'] ){
       remove_action( 'um_before_form', 'um_add_update_notice', 500 );
    }
    

    Regards,

    Plugin Support Ultimate Member Support

    (@ultimatemembersupport)

    Hey there!

    This thread has been inactive for a while so we’re going to go ahead and mark it Resolved.

    Please feel free to re-open this thread by changing the Topic Status to ‘Not Resolved’ if any other questions come up and we’d be happy to help. 🙂

    Regards,

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Custom tab remove update account’ is closed to new replies.