Skip to content

Commit

Permalink
Filter which providers should be available to users
Browse files Browse the repository at this point in the history
  • Loading branch information
iandunn committed Nov 9, 2022
1 parent 9d29c05 commit 1e27add
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions wporg-two-factor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}

0 comments on commit 1e27add

Please sign in to comment.