• This works fine when the user first puts in his username and password.
    However, if the user is already logged in, and clicks on the members link he is not redirected to the set page but the ugly ‘profile’ page is shown.

    Is there any way to make this work consistently whenever the user goes to the membership login page? I.e. if he is not logged in display the login page and redirect to the required URL after successful log in, if he is already logged in take him to the URL.

    https://wordpress.org/plugins/simple-membership-after-login-redirection/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support mbrsolution

    (@mbrsolution)

    Hi, let me get this right. The user is logged in and then they try to go to the redirect URL. Is that correct?

    Thread Starter jbx

    (@jbx)

    Well what they will do is click on the Members link, which if not logged in will display the login page (and then automatically it redirects them to the redirect url after they log in). The problem is if they go to the same page and they’re already logged in, they don’t go to the the Redirect URL but stay on that weird profile page.

    If for example I have a ‘Members’ link on top, the user might click on that (maybe forgetting that he has already logged in, or maybe he had the ‘Remember Me’ turned on, or maybe just to go to the Members home page quickly).

    I sort of got around it by putting a special page in my theme page-membership-login.php and added this to the top:

    <?php if(SwpmMemberUtils::is_member_logged_in()) {
        $url = //my members url;
        wp_redirect($url);
        exit;
    } ?>

    Sort of a hack, because ideally its in just one place.

    Plugin Support mbrsolution

    (@mbrsolution)

    Hi, that is a great idea. The plugin developers will look at your solution closely.

    Regards

    Plugin Author wp.insider

    (@wpinsider-1)

    It is intentional that we don’t auto redirect when a user goes to the login page. If they are logged into the system, then it will show them a little widget indicating that they are logged into the system and show some other little info.

    What we can do is add an action hook there so you can add your custom redirection code and override the default functionality.

    I’m after doing something similar…

    How do I create a hyperlink that I can put on a sidebar that when the user clicks it takes them to their membership url set using the plugin?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Does not redirect if the user is already logged in and goes to the login page’ is closed to new replies.