php 重定向到其他登录页面

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php 重定向到其他登录页面相关的知识,希望对你有一定的参考价值。

function prevent_wp_login() {
    // WP tracks the current page - global the variable to access it
    global $pagenow;
    // Check if a $_GET['action'] is set, and if so, load it into $action variable
    $action = (isset($_GET['action'])) ? $_GET['action'] : '';
    // Check if we're on the login page, and ensure the action is not 'logout'
    if( $pagenow == 'wp-login.php' && ( ! $action || ( $action && ! in_array($action, array('logout', 'lostpassword', 'rp', 'resetpass'))))) {
        // Load the home page url
        $page = get_permalink(um_get_option('core_login'));
        // Redirect to the home page
        wp_redirect($page);
        // Stop execution to prevent the page loading for any reason
        exit();
    }
}

以上是关于php 重定向到其他登录页面的主要内容,如果未能解决你的问题,请参考以下文章

有一个 PHP 重定向到登录页面,而不是强制登录

登录以重定向到其他页面

vuejs - 如果已经登录,则从登录/注册重定向到主页,如果未登录 vue-router,则从其他页面重定向到登录

使用php重定向登录页面

php 在登录时将WooCommerce客户重定向到商店页面

即使我输入正确的密码,为什么我总是被重定向到登录页面?