Merge pull request #8351 from MikeHansenMe/master

Fix broken password reset
This commit is contained in:
Mike Jolley 2015-06-11 10:43:15 +01:00
commit a3ed5efcd9
1 changed files with 8 additions and 3 deletions

View File

@ -130,10 +130,15 @@ function wc_edit_address_i18n( $id, $flip = false ) {
* @access public
* @return string
*/
function wc_lostpassword_url() {
return wc_get_endpoint_url( 'lost-password', '', wc_get_page_permalink( 'myaccount' ) );
function wc_lostpassword_url( $default_password_reset_url ) {
$wc_password_reset_url = wc_get_page_permalink( 'myaccount' );
if ( false !== $wc_password_reset_url ) {
return wc_get_endpoint_url( 'lost-password', '', $wc_password_reset_url );
} else {
return $default_password_reset_url;
}
}
add_filter( 'lostpassword_url', 'wc_lostpassword_url', 10, 0 );
add_filter( 'lostpassword_url', 'wc_lostpassword_url', 10, 1 );
/**