-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'login_url' filter issue with 'home_url()' #44
Comments
I'm not sure exactly what the issue is here? Can you post the relevant part of your code (including the |
Thanks for the reply. Here is the code: function health_login_url( $login_url, $redirect ){
return home_url('/login');
}
add_filter( 'login_url', 'health_login_url', 10, 2); The expected output/effect is for the user to be directed to the /login page of the site they are on, when usually they would have been directed to /wp-login.php. This works as expected on any site where it is just a subdomain on the main network domain (e.g. subdom.networkdom.com), but does not work if there is a mapped domain (e.g. mappeddomain.com, which is mapped to subdom2.networkdom.com). The function itself works, since if I use:
for example, then when a user would usually get directed to /wp-login.php, they would instead get directed to google.com. This means it must be something about the combination of using this filter, with Mercator active, on a site with a mapped domain. I have also tried site_url(), and get_home_url() and get_site_url(), but none of them work in this instance. Does that make sense? Let me know if you need any other details. Thanks. |
Any ideas @rmccue ? |
Or if no ideas on how to solve this issue exactly, do you have any thoughts on any other Wordpress functions I could use to get the correct site URL whilst using the login_url filter? I could imagine many people using this plugin might also want to use the login_url filter, to create custom login pages... Thanks |
Hi @rmccue I'm not expecting direct support, but could you let me know if you are unable to look at this at all, so I can decide whether or not to pursue other avenues? Thank you. |
@josephclawrence Sorry for the late reply here, totally forgot! I tried this locally, and it was working for me when I dump out |
@josephclawrence I think the updates I made in our fork (and pending pull request to official mercator) might have fixed the issue with your filter. I appled your filter after the sunrise config and it properly changed the "login url" that comes built into the wordpress core "meta" widget. |
Thanks Seth, that's great news. I will have a look at this early 2016 :) On Wed, Dec 9, 2015 at 12:35 AM, Seth Carstens [email protected]
Director |
Hi
I have function making use of the 'login_url' filter, to use a custom user login page for sites on my network. In it I return a new login URL that I generate using the 'home_url()' function, since I determined that to be the best function to use to return the correctly mapped domain for a given site.
It doesn't work, however. My 'login_url' filter function works, since if I set it manually to another page on the site, or to google.com or something it works fine. It seems that I cannot properly use 'home_url()' (or 'site_url()' for that matter) on mapped domains when using Mercator. The function works fine for subdomains on my main network domain, just not for mapped domains.
Any ideas? Thanks.
The text was updated successfully, but these errors were encountered: