• Resolved Ollie Treend

    (@ollietreend)


    Hi,

    First – thanks for your plugin. It’s proving to be a life saver!

    I have one question though. I have created a page upon which I have both the TML login and register shortcodes running.

    Taken from my template:


    <div class="account-login">
    <?php

    theme_my_login(array(
    'default_action' => 'login',
    'show_title' => false,
    'instance' => 1,
    ));

    ?>
    </div>
    <div class="account-register">
    <?php

    theme_my_login(array(
    'default_action' => 'register',
    'show_title' => false,
    'instance' => 2,
    ));

    ?>
    </div>

    I have the User Moderation module enabled as I need users to verify their email address before being able to login.

    Upon registering, users are redirected back to the default /login/ page where it shows the message “Please check your emails to verify…”.

    How can I change it so that it redirects users back to my custom login & register page?

    I’ve tried diving into the TML code to see if there are any hooks or filters that can be used to affect this behaviour. The only filters that I’ve found are tml_redirect_url and registration_redirect, but they simply contain whole URLs. It feels a bit risky just editing those URLs – surely there’s a better/more reliable/more obvious way to tell TML to redirect to a different page? I’m not sure if I’m going in the right direction with this at the moment..

    Any advice would be great.

    Thanks

    https://www.ads-software.com/plugins/theme-my-login/

Viewing 1 replies (of 1 total)
  • Plugin Author Jeff Farthing

    (@jfarthing84)

    Place the following code in either wp-content/plugins/theme-my-login-custom.php or your theme’s functions.php file.

    function my_registration_redirect() {
        return 'YOUR URL HERE';
    }
    add_filter( 'registration_redirect', 'my_registration_redirect' );
Viewing 1 replies (of 1 total)
  • The topic ‘Change redirects when login & register on same page?’ is closed to new replies.