Created
August 26, 2019 13:17
-
-
Save paulgoodchild/15883f73052c284c020fe3b8a9d3b25d to your computer and use it in GitHub Desktop.
Filter to adjust whether Two-Factor Authentication is applied to a logged-in user in Shield
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'icwp-wpsf-user_subject_to_login_intent', function ( $bUserSubjectTo2FA, $oWpUser ) { | |
/** | |
* Insert Your logic here. | |
* Parameter $oWpUser is a WP_User object. | |
* Always return a boolean true/false from this function. | |
* In this example, if User ID is 1, always apply 2FA rules | |
*/ | |
if ( $oWpUser->ID === 1 ) { | |
$bUserSubjectTo2FA = true; | |
} | |
return $bUserSubjectTo2FA; | |
}, | |
100, 2 | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment