WordPress.org

Support

Support » Plugins and Hacks » WP-Members: Membership Framework » [Resolved] Login Page Redirect

[Resolved] Login Page Redirect

Viewing 3 replies - 1 through 3 (of 3 total)
  • I was able to resolve the issue from Chad’s previous post using,

    add_filter( ‘wpmem_login_redirect’, ‘my_login_redirect’ );

    function my_login_redirect()
    {
    // return the url that the login should redirect to
    return ‘http://yourdomain.com/your-page’;
    }

    But now I want the link
    ‘http://christembassyarlington.org/login/’
    always redirected to
    ‘http://christembassyarlington.org/live-service/’
    when a member is already logged in.
    Thanks

    Plugin Author Chad Butler

    @cbutlerjr

    You could use a combination of is_page(‘login’) and is_user_logged_in. If both return true, redirect.

    if( is_page( 'login' ) && is_user_logged_in() ) {
      wp_redirect( 'http://christembassyarlington.org/live-service/' );
      exit();
    }

    You could work that in in a number of ways; the easiest probably being directly in the page template. But with redirection being part of that process, you should probably put it into a hook that occurs before headers are sent, such as ‘init’

    Wow…..Thanks man. Worked like a charm. I appreciate it.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Login Page Redirect’ is closed to new replies.
Skip to toolbar