Skip to content

Commit 1040a48

Browse files
authored
Merge pull request #250 from WPUserManager/#223
Allow admins to prevent authentication method
2 parents a1a17bb + 92b837f commit 1040a48

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

includes/filters.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,11 @@ function wpum_login_url( $login_url, $redirect, $force_reauth ) {
143143
*/
144144
function wpum_authentication( $user, $username, $password ) {
145145

146+
// Skip authentication method for admin users
147+
if ( ! is_wp_error( $user ) && user_can( $user, 'administrator' ) ) {
148+
return $user;
149+
}
150+
146151
$authentication_method = wpum_get_option( 'login_method' );
147152

148153
if ( $authentication_method == 'username' ) {

0 commit comments

Comments
 (0)