-
Author
-
February 23, 2017 at 23:42 #154069arbolifeParticipant
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
February 24, 2017 at 18:24 #154119RaduModeratorYes 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 CODEfunction 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 solutionFebruary 24, 2017 at 18:58 #154122arbolifeParticipantHi 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,
MarcFebruary 24, 2017 at 19:20 #154126RaduModeratorTry to use this instead
COPY CODEfunction 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 solutionFebruary 25, 2017 at 00:55 #154145arbolifeParticipantHi Radu,
Thanks, it works only when I put priority 9 instead of 11. Does that make sense?
COPY CODEfunction sq7_rdu_redirect( $redirect_to, $request, $user ) { $redirect_to = get_permalink(); return $redirect_to; } add_filter('login_redirect', 'sq7_rdu_redirect', 9, 3);
Best,
MarcFebruary 27, 2017 at 16:47 #154263RaduModeratorHi,
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 -
AuthorPosts
The forum ‘Bugs & Issues’ is closed to new topics and replies.