Skip to content

Include a fix for alternate login forms.#62

Merged
valendesigns merged 1 commit intomasterfrom
issues/61
Sep 24, 2015
Merged

Include a fix for alternate login forms.#62
valendesigns merged 1 commit intomasterfrom
issues/61

Conversation

@georgestephanis
Copy link
Collaborator

In situations where login_header() is inaccessible (because we’re on a
page other than wp-login.php because of a plugin or something) manually
redefine login_header() so we can call it there as well.

Also make sure we’re always submitting to the correct page and links go
to the correct page — wp_login_url() — if a plugin changes that, they
should also be reordering things to call the actions we use so that it
still works.

Resolves issues with WooCommerce logins from front-end pages. 👍

Fixes #61

In situations where login_header() is inaccessible (because we’re on a
page other than wp-login.php because of a plugin or something) manually
redefine `login_header()` so we can call it there as well.

Also make sure we’re always submitting to the correct page and links go
to the correct page — `wp_login_url()` — if a plugin changes that, they
should also be reordering things to call the actions we use so that it
still works.

Resolves issues with WooCommerce logins from front-end pages. 👍

Fixes #61
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incidentally, when I first wrote this, I don't know why I thought wp-includes/functions.wp-login.php existed -- it never has best as I can tell.

@valendesigns
Copy link
Collaborator

There is no other way than to duplicate the login_header function?

@georgestephanis
Copy link
Collaborator Author

The core login_header() function is defined in wp-login.php, right after it re-requires wp-load.php and would attempt to redefine ABSPATH and such. There is no other way to include the core version of the function. :(

@georgestephanis
Copy link
Collaborator Author

@valendesigns
Copy link
Collaborator

Just speaking out load here, but how would we overcome this issue during merge if we can't get the functions moved out of wp-login.php? We certainly can't duplicate functions in Core and if we can't get them moved we have a very real issue here. I think we need to start the lobbying now and present a unified front on this. We could try and discuss this in Slack and see if we can get buy in on the issue. We need to reopen 20279 with a compelling reason.

@georgestephanis
Copy link
Collaborator Author

The other option is to just wp_safe_redirect() the user to wp-login.php -- the difficulty is that some plugins set up a redirect from wp-login.php to their front-end login page with some plugins, which would be an eternal redirect loop -- hence why I did it this way.

I agree that we may need to implement something else for mergeability, but for the moment, this suffices.

cc: @markjaquith for input on core architecture and such.

@valendesigns
Copy link
Collaborator

Did some testing with WooCommerce and everything looks good.

valendesigns added a commit that referenced this pull request Sep 24, 2015
Include a fix for alternate login forms.
@valendesigns valendesigns merged commit 942023c into master Sep 24, 2015
@shield-9 shield-9 deleted the issues/61 branch October 22, 2016 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants