This topic has 5 replies, 2 voices, and was last updated 7 years by Radu.

  • Author
  • #154069
     arbolife
    Participant

    Hi,

    I have both the Login redirect for Popup setting and the Redirect after Facebook Registration settings set to reload current page. Yet when a user logs in with the pop-up using Facebook it works well, but if they use username/password, they get redirected to their BuddyPress profile.

    How can I correct this behaviour ?

    Thanks,

    Marc

    #154119
     Radu
    Moderator

    Yes because those are for specific cases like it’s written

    Login redirect for Popup and Redirect after Facebook Registration so for the other login case you will have to use a function like the next one

    COPY CODE
    
    function sq7_rdu_redirect( $redirect_to, $request, $user ) {
        $redirect_to = '/my-route-after-redirect/';
        return $redirect_to;
    }
    add_filter('login_redirect', 'sq7_rdu_redirect', 11, 3);
    

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #154122
     arbolife
    Participant

    Hi Radu,

    True, it makes sense… but from a usability perspective why would I want to define a redirect for Facebook only and not for a user using a password ?

    I don’t mind coding this in my child theme, could you please elaborate on how this line would look like to reload the current page (below the popup):
    $redirect_to = '/my-route-after-redirect/';

    Thanks,
    Marc

    #154126
     Radu
    Moderator

    Try to use this instead

    COPY CODE
    
    function sq7_rdu_redirect( $redirect_to, $request, $user ) {
        $redirect_to = get_permalink();
        return $redirect_to;
    }
    add_filter('login_redirect', 'sq7_rdu_redirect', 11, 3);
    

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #154145
     arbolife
    Participant

    Hi Radu,

    Thanks, it works only when I put priority 9 instead of 11. Does that make sense?

    COPY CODE
    function sq7_rdu_redirect( $redirect_to, $request, $user ) {
        $redirect_to = get_permalink();
        return $redirect_to;
    }
    add_filter('login_redirect', 'sq7_rdu_redirect', 9, 3);

    Best,
    Marc

    #154263
     Radu
    Moderator

    Hi,

    Ok then if it works in that priority

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 6 posts - 1 through 6 (of 6 total)

The forum ‘Bugs & Issues’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?