Skip to content

Commit

Permalink
Don't rely on user passed into user_has_cap. (#319)
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenDufresne authored Oct 23, 2024
1 parent 967c4ac commit fe0a981
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wporg-two-factor.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ function remove_super_admins_until_2fa_enabled() : void {
* perform privileged actions on the front end, via the REST API, etc.
*/
function remove_capabilities_until_2fa_enabled( array $allcaps, array $caps, array $args, WP_User $user ) : array {
if ( 0 === $user->ID || ! user_requires_2fa( $user ) ) {
if ( 0 === $user->ID || $user->ID !== get_current_user_id() || ! user_requires_2fa( $user ) ) {
return $allcaps;
}

Expand Down

0 comments on commit fe0a981

Please sign in to comment.