- This topic has 2 replies, 2 voices, and was last updated 9 years, 5 months ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- The topic ‘Redirect Priority’ is closed to new replies.
Hey Syam,
tried to use the built-in login redirect feature but we have an issue with our existing logic.
when users click on a page link that is only accessible by members, they’ll be redirected to a front-end-login form (using theme-my-login here) with added ‘redirect-to’ GET-parameter. this works fine so far.
but when setting a global login redirect via your plugin, it is always using this defined redirect, not the more specific one already supplied.
since one cannot freely change the priorities for each login redirect entry, how can we achieve to respect more specific redirect urls?
do you have an idea how this can be done? is there any filter hook we could use?
thanks in advance,
the custom login url looks like this:
http://wp.dev/login/?redirect_to=http%3A%2F%2Fwp.dev%2Fmy-custom-member-page%2Fanother-subpage%2F&reauth=1
Hi Daniel,
I don’t think I quite understand what your scenario is.
Here is how Login Redirect works. It internally uses a WordPress filter called ‘login_redirect’. This filter will be called from wp-login.php after a user has been logged into your system to find the redirect location. Usually it doesn’t matter how the login form is created (by a plugin/theme), it always posts the data to wp-login.php so this filter will be executed.
‘redirect_to’ is a WordPress recognizable parameter, which will be extracted in wp-login.php and passed as an argument to this filter. User Role Editor tries to find the redirect URL based on the configurations and if it finds one, returns that URL from the filter else returns the passed ‘redirect_to’.
Calling this filter and setting its value as ‘redirect_to’ within the login URL will not work, since the filter requires a logged in user to find the URL.
Thanks
Syam