屏蔽隐藏WordPress默认登录页面

最近发现有很多用户通过默认注册登录页面进行注册登录,不安全也不方便。

//让用户访问自带登陆页面时直接跳转到指定页面
if (!function_exists('login_protection')) {
    function login_protection()
    {
        //这里是可以自定义一共路径/index.php/login
        if ($_GET['superuser'] != 'password') header('Location: /index.php/login');
        //当然你也可以禁止所有人访问,也就是直接跳转/index.php/login
        //header('Location: /index.php/login');
    }
    add_action('login_enqueue_scripts','login_protection');
}
© 版权声明
THE END
喜欢就支持一下吧
点赞10 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称

    暂无评论内容