mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
- fixed updating display_name if there is set the User Display Name setting to Default WP Display Name in UM > General > Users > Display name;
- fixed typo in the password validation
This commit is contained in:
@@ -462,8 +462,27 @@ function um_user_edit_profile( $args ) {
|
||||
*/
|
||||
$to_update = apply_filters( 'um_user_pre_updating_profile_array', $to_update, $user_id );
|
||||
|
||||
|
||||
if ( is_array( $to_update ) ) {
|
||||
|
||||
if ( isset( $to_update['first_name'] ) || isset( $to_update['last_name'] ) || isset( $to_update['nickname'] ) ) {
|
||||
$user = get_userdata( $user_id );
|
||||
if ( ! empty( $user ) && ! is_wp_error( $user ) ) {
|
||||
UM()->user()->previous_data['display_name'] = $user->display_name;
|
||||
|
||||
if ( isset( $to_update['first_name'] ) ) {
|
||||
UM()->user()->previous_data['first_name'] = $user->first_name;
|
||||
}
|
||||
|
||||
if ( isset( $to_update['last_name'] ) ) {
|
||||
UM()->user()->previous_data['last_name'] = $user->last_name;
|
||||
}
|
||||
|
||||
if ( isset( $to_update['nickname'] ) ) {
|
||||
UM()->user()->previous_data['nickname'] = $user->nickname;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
UM()->user()->update_profile( $to_update );
|
||||
/**
|
||||
* UM hook
|
||||
|
||||
Reference in New Issue
Block a user