Skip to content

Commit

Permalink
Only allow password change on user-edit.php for super admins.
Browse files Browse the repository at this point in the history
See #3406.
  • Loading branch information
boonebgorges committed Jul 18, 2024
1 parent 0cf056e commit e57a7e8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions wp-content/plugins/wds-citytech/includes/passwords.php
Original file line number Diff line number Diff line change
Expand Up @@ -361,3 +361,10 @@ function delete_password_expiration_warning_dismissed_usermeta( $user_login, $us
delete_user_meta( $user->ID, 'password_expiration_warning_dismissed' );
}
add_action( 'wp_login', __NAMESPACE__ . '\delete_password_expiration_warning_dismissed_usermeta', 10, 2 );

/**
* Don't show password reset fields on Dashboard > Profile.
*/
add_filter( 'show_password_fields', function() {
return is_super_admin();
} );

0 comments on commit e57a7e8

Please sign in to comment.