Hi,
I want to use some form of email validation along with LLAR. However, there are conflicts between LLAR and the User Verification plugin, and also with this simple script:
/* Only allow administrators to login */
add_filter( 'authenticate', 'my_admin_check', 100, 1 );
function my_admin_check( $user ) {
// Make sure this is a real login attempt, without errors
if ( !is_wp_error($user) ) {
$user_role = $user->roles[0];
// add or remove the roles you want to allow/disallow (can be a custom role or regular WordPress roles)
if ( !in_array( $user_role, array( 'trade_customer' ) ) ){
return new WP_Error( 'login_failed', __( "Only staff can use this login.", "mysite_domain" ) );
} else {
// allow the login
return $user;
}
} else {
// We're just loading the login page, not running a login.
return $user;
}
}
When either the User Verification plugin or the above script fire, the scripts prevent the login, but LLAC considers it to be a failed attempt. The LLAC login warning message shows the count of remaining login attemps, but the warning message for the plugin or script never show. Is there a way we can have either the plugin or this script evaluate first?
TBH, I'm leaning toward using the script because I can adjust the settings I need myself.
Thanks!
Hello wholebiz. We will have our dev team look into this and get back to you once we have more information.
Thanks!
Here's the solution for you:
In the add_filter( 'authenticate', 'my_admin_check', 100, 1 ); line change 100 to 4
Let us know if this worked.
Thank you, but I discovered that I need to stick with the User Verification plugin because my membership system, Memberpress, is tightly integrated with that.
Are you able to help me accommodate User Verification?
https://wordpress.org/plugins/user-verification/