admin_init | WordPress.org

[ad_1]

have a custom theme here and use the admin_init hook. Inside I query this here to not redirect admins.

        if ( !current_user_can( "edit_posts" ) && ($localhosturltest != $_SERVER["PHP_SELF"]) ) {     
            wp_redirect(home_url());
            exit;
        };

Now when I try to log in with 2FA enabled and set up, the PIN code entry doesn’t appear and I just get a message that the verification went wrong.

If I remove the code, everything is great.

Can I somehow intercept at this point that WordFence is just passing by here.

Because currently the If query seems to open at this point and run into redirect and exit.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer