diff --git a/wporg-two-factor.php b/wporg-two-factor.php index a09bf10f..14f33029 100644 --- a/wporg-two-factor.php +++ b/wporg-two-factor.php @@ -12,3 +12,18 @@ namespace WordPressdotorg\Two_Factor; defined( 'WPINC' ) || die(); +add_filter( 'two_factor_providers', __NAMESPACE__ . '\two_factor_providers' ); + +/** + * Determine which providers should be available to users. + */ +function two_factor_providers( array $providers ) : array { + // Match the name => file path format of input var, but the path isn't needed. + $desired_providers = array( + 'Two_Factor_WebAuthn' => '', + 'Two_Factor_Totp' => '', + 'Two_Factor_Backup_Codes' => '', + ); + + return array_intersect_key( $providers, $desired_providers ); +}