From 03c2cab9a3c07e9659b81957f6d44a7781d2014f Mon Sep 17 00:00:00 2001 From: Kaspars Dambis Date: Thu, 9 Jan 2025 13:22:56 +0200 Subject: [PATCH] Switch back to providers list due to API changes --- class-two-factor-core.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/class-two-factor-core.php b/class-two-factor-core.php index dbe264c6..64ebed8f 100644 --- a/class-two-factor-core.php +++ b/class-two-factor-core.php @@ -1896,7 +1896,10 @@ public static function user_two_factor_options( $user ) { * @return bool True if the provider was enabled, false otherwise. */ public static function enable_provider_for_user( $user_id, $new_provider ) { - if ( ! in_array( $new_provider, self::get_providers_classes(), true ) ) { + $available_providers = self::get_providers(); + + // Ensure the provider is even available. + if ( isset( $available_providers[ $new_provider ] ) ) { return false; }