Merge pull request #13845 from woocommerce/fix-13842

Dont redirect lost password on multisite global pages
This commit is contained in:
Claudio Sanches 2017-03-31 13:05:43 -03:00 committed by GitHub
commit 5aaf23f8a5
1 changed files with 5 additions and 0 deletions

View File

@ -22,6 +22,11 @@ if ( ! defined( 'ABSPATH' ) ) {
* @return string
*/
function wc_lostpassword_url( $default_url = '' ) {
// Don't redirect to the woocommerce endpoint on global network admin lost passwords.
if ( is_multisite() && isset( $_GET['redirect_to'] ) && false !== strpos( $_GET['redirect_to'], network_admin_url() ) ) {
return $default_url;
}
$wc_account_page_url = wc_get_page_permalink( 'myaccount' );
$wc_account_page_exists = wc_get_page_id( 'myaccount' ) > 0;
$lost_password_endpoint = get_option( 'woocommerce_myaccount_lost_password_endpoint' );