• Resolved nathaniel45

    (@nathaniel45)


    I have looked in the UM settings and in this forum as well as google for the answer but no luck. How do I add a logout link/button/tab in the user account area? I can’t believe this would be an issue but it is. I do not see why I would have to add this by programming a new tab but that is all I found on this topic.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support andrewshu

    (@andrewshu)

    Hello @nathaniel45

    Unfortunately, this functionality does not exist in our plugin at this time. You could add the logout to the nav menu as the logout page.

    Regards.

    Thread Starter nathaniel45

    (@nathaniel45)

    I added the menu, what do you do to get it to show on the account page?

    • This reply was modified 1 year, 2 months ago by nathaniel45.
    Thread Starter nathaniel45

    (@nathaniel45)

    so in order to add a link on the account page I had to edit the account.php template file. It’s not a big issue because for years I have been editing the core files for class-account.php and um-actions-account.php to add the registration form fields. For each new version of UM I have to edit my files.

    • This reply was modified 1 year, 2 months ago by nathaniel45.
    • This reply was modified 1 year, 2 months ago by nathaniel45.
    Plugin Support andrewshu

    (@andrewshu)

    Hello @nathaniel45

    You need to use hook and then you won’t need to edit files every time after updating.

    Regards.

    Plugin Support andrewshu

    (@andrewshu)

    Hi @nathaniel45

    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 if any other questions come up and we’d be happy to help. ??

    Regards

    Thread Starter nathaniel45

    (@nathaniel45)

    Sorry for my delay in responding. There is not a hook to add fields to the account tab page that I have found. I had to program it in UM core files to load from a form I made that has the same form questions for registration. Maybe you could simply let us do this under forms like you do for Profile Form.

    @nathaniel45

    You can try to use the um_after_account_{$tab_id}_button Action hook
    to add a Logout button to the right of the “Update Account” button
    either in the “General” Tab Page or all Account Tab Pages.

    https://docs.ultimatemember.com/article/1012-umafteraccounttabidbutton

    Thread Starter nathaniel45

    (@nathaniel45)

    I want the logout were it should be and were Woocommerce has it on the side nav. This is what I have so not to have to edit the core files.

    <?php 
    add_action( 'um_after_account_page_load', 'my_after_account_page_load', 10 );
    function my_after_account_page_load() {
    		     // your code here
    		     ?>
    <script>
    jQuery( document ).ready(function() {
    	var url = "https://{yoursiteurl}/logout/";
    	
    	jQuery(".um-account-side ul").append('<li><a href="'+url+'" class="um-account-link account-logout"><span class="um-account-icontip uimob800-show um-tip-w" original-title="Logout"><i class="um-faicon-sign-out"></i></span><span class="um-account-icon uimob800-hide"><i class="um-faicon-sign-out"></i></span><span class="um-account-title uimob800-hide">Logout</span><span class="um-account-arrow uimob800-hide"><i class="um-faicon-angle-right"></i></span></a></li>');
    	
    	jQuery(".um-account-main").append('<div class="um-account-nav uimob340-show uimob500-show"><a href="'+url+'" class="account-logout">Logout<span class="ico"><i class="um-faicon-sign-out"></i></span></a></div>');
    	
        jQuery('.account-logout').on("click",function(e) {
    		e.stopPropagation();
            window.location.replace(url);
        });
    	
    });
    
    	</script>
    <?php
    }

    I still do not have a way in adding fields to the account page to match the added form fields I have in the user registration form unless I program it in the core files.

    • This reply was modified 1 year, 2 months ago by nathaniel45.
Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Logout in account’ is closed to new replies.