是的,有。您可以使用authenticate 挂钩:
add_action( \'authenticate\' , \'check_custom_authentication\', 20, 3 );
function check_custom_authentication ( $user, $username, $password ) {
if ( is_a($user, \'WP_User\') && in_array(\'pending\', $user->roles) ) {
return new WP_Error(\'pending\', \'Your error msg\');
}
}