Changeset 13932
- Timestamp:
- 07/29/2024 02:56:28 AM (7 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/common/includes/wporg-sso/wp-plugin.php
r13926 r13932 81 81 add_action( 'wp_login', array( $this, 'record_last_logged_in' ), 10, 2 ); 82 82 add_action( 'profile_update', array( $this, 'record_last_password_change' ), 10, 3 ); 83 add_action( 'wp_set_password', array( $this, 'record_last_password_change_reset' ), 10, 3 ); 83 84 84 85 add_action( 'login_form_logout', array( $this, 'login_form_logout' ) ); … … 871 872 } 872 873 874 /** 875 * Record the last date a user changed their password via password reset. 876 */ 877 public function record_last_password_change_reset( $password, $user_id, $old_user_data ) { 878 $user = get_user_by( 'id', $user_id ); 879 if ( $old_user_data->user_pass !== $user->user_pass ) { 880 update_user_meta( $user_id, 'last_password_change', gmdate( 'Y-m-d H:i:s' ) ); 881 } 882 } 883 873 884 } 874 885
Note: See TracChangeset
for help on using the changeset viewer.