Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Plugin: Force Login for Member Pages


Kieran
Participant

@cozzie

Hi Trent

Thanks a lot for this super useful plugin

I send users to to /wp-login.php and I hope to redirect them from here to the original link that they tried to view, do you have any idea how they can achieve this?

I tried this:

$ref = $_SERVER[‘HTTP_REFERER’];

bp_core_redirect(get_bloginfo(‘siteurl’) . ‘/wp-login.php?redirect_to=’.$ref);

but it sends users to the previously viewed page rather than the link they tried to view.

For example if a user arrives at the homepage and clicks on a link they are sent to /wp-login.php to login, once logged in they are returned to the homepage not the page they wanted to view. This becomes more of a problem for users accessing the site from a link in an email (e.g. a friends invitation) because they are given no page to redirect to after logging in.

thanks a lot, a lot for any help!!

Skip to toolbar