Changing password authentiaction to alpha-numeric in learndash plugin

24 Views Asked by At

im trying to change default password authentication method in learndash plugin to accept alpha-numeric keys only. i've tried following hook to to get desired outcome, but its not chaniging anything. any possible solution would be highly appreciated.

function updating_password_policy($errors, $user) {
    $password = isset($_POST['password']) ? $_POST['password'] : '';
    if (strlen($password) > 12 || !preg_match('/[0-9]+/', $password)) {
        $errors->add('password_too_short', __('Password must be at least 12 characters'));
    }
    return $errors;
}
add_filter('registration_errors', 'updating_password_policy', 10, 2);
add_filter('user_profile_update_errors', 'updating_password_policy', 10, 2);
0

There are 0 best solutions below