• Resolved coxinha

    (@coxinha)


    Dear all,

    I’ve extended my member account page with custom tab and content (only text) as shown in the documentation here: https://docs.ultimatemember.com/article/65-extend-ultimate-member-account-page-with-custom-tabs-content

    Here my code:

    /* add new tab called "mytab" */
    
    add_filter('um_account_page_default_tabs_hook', 'my_custom_tab_in_um1', 100 );
    function my_custom_tab_in_um1( $tabs ) {
    	$tabs[900]['newsletter']['icon'] = 'um-faicon-envelope';
    	$tabs[900]['newsletter']['title'] = 'Newsletter';
    	$tabs[900]['newsletter']['custom'] = true;
    	return $tabs;
    }
    	
    /* make our new tab hookable */
    
    add_action('um_account_tab__newsletter', 'um_account_tab__mytab1');
    function um_account_tab__mytab1( $info ) {
    	global $ultimatemember;
    	extract( $info );
    
    	$output = $ultimatemember->account->get_tab_output('newsletter');
    	if ( $output ) { echo $output; }
    }
    
    /* Finally we add some content in the tab */
    
    add_filter('um_account_content_hook_newsletter', 'um_account_content_hook_mytab1');
    function um_account_content_hook_mytab1( $output ){
    	ob_start();
    	?>
    
    <div class="um-field um-field-newsletter um-field-select um-field-type_select" data-key="nl">
    <div class="um-field-label"><label for="newsletter">Vom Newsletter ab- und anmelden</label>
    <div class="um-clear"></div></div>
    </span>
    
    <div class="um-field-area">
    <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p>
    </div>
    	
    	<?php
    
       $output .= ob_get_contents();
       ob_end_clean();
       return $output;		
    }

    After updating to 2.x there is suddenly a button on the below which I don’t need. Please tell me how I can remove it.

    Thanks in advance and many regards,
    C.

    • This topic was modified 5 years, 11 months ago by coxinha.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support calumallison

    (@calumallison)

    Hi,

    Can you please contact us via our site: https://ultimatemember.com/contact/sales/ so we can add this to our helpdesk system and help you with this issue.

    Thanks

    your problem was the div class is not closed See comments in code

    /* make our new tab hookable */
    
    add_action('um_account_tab__newsletter', 'um_account_tab__mytab1');
    function um_account_tab__mytab1( $info ) {
    	global $ultimatemember;
    	extract( $info );
    
    	$output = $ultimatemember->account->get_tab_output('newsletter');
    	if ( $output ) { echo $output; }
    }
    
    /* Finally we add some content in the tab */
    
    add_filter('um_account_content_hook_newsletter', 'um_account_content_hook_mytab1');
    function um_account_content_hook_mytab1( $output ){
    	ob_start();
    	?>
    <! -- This class below was left open -->
    <div class="um-field um-field-newsletter um-field-select um-field-type_select" data-key="nl">
    <div class="um-field-label"><label for="newsletter">Vom Newsletter ab- und anmelden</label>
    <div class="um-clear"></div></div>
    </span>
    
    <div class="um-field-area">
    <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p>
    </div>
    <! -- added the closing tag below -->
    	</div>
    	<?php 
    
       $output .= ob_get_contents();
       ob_end_clean();
       return $output;		
    }

    I just tested on my install and it works fine the button on the page does nothing but everything displays

    • This reply was modified 5 years, 11 months ago by Mike.
    Thread Starter coxinha

    (@coxinha)

    Hi bigmikey00,

    thanks a lot for your amendment. I’ve changed my code as suggested.

    My point is that I don’t want this button below. Before version 2.x it didn’t appear. After the update all my custom tabs are extended with following html-code:

    <div class=”um-col-alt um-col-alt-b”>
    <div class=”um-left”>
    <input name=”um_account_submit” id=”um_account_submit” class=”um-button” value=”Datenschutz” type=”submit”>
    </div>
    <div class=”um-clear”></div>
    </div>

    So I guess there was a code change and I would like to know how to remove this button. Any ideas?

    • This reply was modified 5 years, 11 months ago by coxinha.
    • This reply was modified 5 years, 11 months ago by coxinha.
    • This reply was modified 5 years, 11 months ago by coxinha.
    Thread Starter coxinha

    (@coxinha)

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Extended Member Account page shows after update to 2.x a button’ is closed to new replies.