-
Notifications
You must be signed in to change notification settings - Fork 157
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
Fix a login issue on WP-Engine hosting #257
Conversation
WP-Engine requires additional parameters to exist on the URL for POST requests, and it applies those using a filter on the site_url hook when using the login_post scheme. So I've made sure to apply that filter when running in a WP-Engine environment.
5113dac
to
856e79c
Compare
@@ -318,6 +318,12 @@ public static function login_html( $user, $login_nonce, $redirect_to, $error_msg | |||
$interim_login = isset( $_REQUEST['interim-login'] ); // WPCS: override ok. | |||
$wp_login_url = wp_login_url(); | |||
|
|||
// If we're running in a WP-Engine environment then we need to apply the | |||
// site_url filter with the login_post scheme for the form action. | |||
if ( function_exists( 'is_wpe' ) && is_wpe() ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ccoley This is a host specific integration and the function name is pretty generic and could conflict with existing code bases.
In #256 @cameronjonesweb suggested to switch to site_url()
for the form action URLs to match how the WP core does it, which should also resolve this issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kasparsd I was going to use site_url()
but I looked back in the code and saw that you were originally using that, but then changed it to use wp_login_url()
in this pull request to fix WooCommerce login forms and issue #61.
I thought that my way of doing it was less likely to cause negative side effects, but I'm happy to use site_url()
instead if that is what you want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, if the is_wpe()
function is too generic, then we could also check for existence of the IS_WPE
environment variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed that WooCommerce on-page login form works as expected with the wp-login.php
form action.
Fixed in #258. |
WP-Engine requires additional parameters to exist on the URL for POST requests, and it applies those using a filter on the site_url hook when using the login_post scheme. So I've made sure to apply that filter when running in a WP-Engine environment.
Fixes #201