This is a great idea @sgrx!
One solution would be to remove the following hooks for all subscribers:
remove_action( 'show_user_profile', array( 'Two_Factor_Core', 'user_two_factor_options' ) );
remove_action( 'edit_user_profile', array( 'Two_Factor_Core', 'user_two_factor_options' ) );
Doing so during admin_init should work just fine:
add_action( 'admin_init', function() {
if ( class_exists( 'Two_Factor_Core' ) && current_user_can( 'subscriber' ) ) {
remove_action( 'show_user_profile', array( 'Two_Factor_Core', 'user_two_factor_options' ) );
remove_action( 'edit_user_profile', array( 'Two_Factor_Core', 'user_two_factor_options' ) );
}
} );
Thread Starter
sgrx
(@sgrx)
Thanks!
This just hides the options if a subscriber views their profile page, correct? Admins would still be able to edit a subscriber and set 2 factor options for them. Can/should that also be disabled to prevent any inconsistencies?
Also, how long is the email code valid for? 1 hour?
-
This reply was modified 7 years, 5 months ago by
sgrx.