• Resolved tiitosport

    (@tiitosport)


    Hi team, I hope you are well ??

    I use the default Ultimate Member Account shortcode on a page: [ultimatemember_account]. The page contains this shortcode and other information. It’s not only an account page.

    Whenever the user clicks on one of the tabs (general, password, delete account,…), information is displayed, and the page URL changes.

    I want the information to be displayed, but I don’t want the page URL to change. Indeed, when the user clicks on one of the tabs and then refreshes the page, he/she is redirected to a different page than the one he/she used to be.

    Would it be possible to have a PHP function to copy-paste in my functions.php file that makes sure the page URL does not change when the user clicks on one of the tabs?

    For now, the solutions that I have tried either don’t do anything or totally block the ability to click one of the tabs.

    Let me know if you need information from my side.

    Best,

    Tiito

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

    (@andrewshu)

    Hello @tiitosport

    Try to add this hook:

    add_action( 'wp_footer', 'um_account_footer_action', 10000 );
    function um_account_footer_action(){
    	global $post;
    	if ( ! um_is_core_post( $post, 'account' ) && is_user_logged_in() ) {
    		?>
            <script>
    			wp.hooks.addAction( 'um_after_account_tab_changed', 'um_after_account_tab_changed', function( tab ) {
    				window.history.pushState("", "", parent.parent.history.back() );
    			});
            </script>
    		<?php
    	}
    }

    Regards.

    Thread Starter tiitosport

    (@tiitosport)

    Hi @andrewshu it worked perfectly, thanks a lot! Feel free to close this request

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘ultimatemember_account shortcode customization’ is closed to new replies.