mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
Fixed password changed email template
This commit is contained in:
@@ -9,6 +9,8 @@
|
||||
|
||||
if ( $_POST['user_password'] && $_POST['confirm_user_password'] ) {
|
||||
$changes['user_pass'] = $_POST['user_password'];
|
||||
add_filter('send_password_change_email','um_send_password_change_email');
|
||||
|
||||
}
|
||||
|
||||
foreach( $_POST as $k => $v ) {
|
||||
|
||||
@@ -34,14 +34,16 @@
|
||||
add_action('um_change_password_process_hook','um_change_password_process_hook');
|
||||
function um_change_password_process_hook( $args ) {
|
||||
global $ultimatemember;
|
||||
extract( $args );
|
||||
|
||||
wp_set_password( $args['user_password'], $args['user_id'] );
|
||||
|
||||
delete_user_meta( $args['user_id'], 'reset_pass_hash');
|
||||
delete_user_meta( $args['user_id'], 'reset_pass_hash_token');
|
||||
|
||||
|
||||
do_action('um_after_changing_user_password', $args['user_id'] );
|
||||
|
||||
|
||||
if ( is_user_logged_in() ) {
|
||||
wp_logout();
|
||||
}
|
||||
@@ -50,17 +52,31 @@
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Overrides password changed notification
|
||||
*
|
||||
*/
|
||||
function um_send_password_change_email( $args ){
|
||||
|
||||
global $ultimatemember;
|
||||
|
||||
um_fetch_user( $user_id );
|
||||
|
||||
$ultimatemember->user->password_changed();
|
||||
|
||||
um_reset_user();
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/***
|
||||
*** @This is executed after changing password
|
||||
***/
|
||||
add_action('um_after_changing_user_password','um_after_changing_user_password');
|
||||
function um_after_changing_user_password( $user_id ) {
|
||||
global $ultimatemember;
|
||||
um_fetch_user( $user_id );
|
||||
|
||||
$ultimatemember->mail->send( um_user('user_email'), 'changedpw_email' );
|
||||
|
||||
um_reset_user();
|
||||
|
||||
}
|
||||
|
||||
/***
|
||||
|
||||
@@ -610,7 +610,8 @@ function um_profile_id() {
|
||||
***/
|
||||
function um_requesting_password_change() {
|
||||
global $post, $ultimatemember;
|
||||
if ( um_is_core_page('password-reset') && isset( $_POST['_um_password_change'] ) == 1 )
|
||||
|
||||
if ( um_is_core_page('account') && isset( $_POST['_um_account'] ) == 1 )
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
@@ -1353,3 +1354,4 @@ function um_user( $data, $attrs = null ) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -434,6 +434,15 @@ class UM_User {
|
||||
$this->password_reset_hash();
|
||||
$ultimatemember->mail->send( um_user('user_email'), 'resetpw_email' );
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
*** @password changed email
|
||||
***/
|
||||
function password_changed(){
|
||||
global $ultimatemember;
|
||||
$ultimatemember->mail->send( um_user('user_email'), 'changedpw_email' );
|
||||
}
|
||||
|
||||
/**
|
||||
* @function approve()
|
||||
|
||||
Reference in New Issue
Block a user