JosephGabito / subway-2.0

Subway is a plugin for WordPress that allows you to hide the content of your website to non-logged in visitors and only displays them to logged in users.
http://dunhakdis.com
2 stars 1 forks source link

Custom redirect isn't working #23

Closed ReneLuecking closed 7 years ago

ReneLuecking commented 7 years ago

The function AuthRedirect::getLoginRedirectUrl() returns wrong urls, if redirect type "custom" is used together with the placeholders (%user_id% and %user_name%), because the function wp_get_current_user() returns 0 at this point.

As a solution you could pass the returned value of wp_signon() as second (optional?) parameter. And could you also add it as second parameter for the filter subway_login_redirect for the same reason?

codehaiku commented 7 years ago

Hi @ReneLuecking

Good catch! I've fixed the issue by following your recommendation to passed the wp_signon returned value as a 2nd argument to the said AuthRedirect method.

Please let me know if you catch more things 👍

I've updated the plugin to 2.0.5. Will update the one on .org as well.

Cheers!

codehaiku commented 7 years ago

Closing this issue for now :)