admin管理员组

文章数量:1406950

I have created a custom login page on my site and used the login_url filter to redirect to that page each time there's a request. The filter looks like:

// Login page
function my_login_page($login_url, $redirect, $force_reauth) {
    // This will append /custom-login/ to you main site URL as configured in general settings (ie /)
    $login_url = site_url( '/acceder/', 'login' );
    if ( ! empty( $redirect ) ) {
        $login_url = add_query_arg( 'redirect_to', urlencode( $redirect ), $login_url );
    }
    if ( $force_reauth ) {
        $login_url = add_query_arg( 'reauth', '1', $login_url );
    }
    return $login_url;
}
add_filter('login_url', 'my_login_page', 10, 3);

The problem is that since then everytime I login with my account and try to access the dashboard I can't. Whether I am logged-in or not logged-in I get to my custom login page.

Is there a way to solve this problem? So far I tried:

  • Remove .htaccess and restore it.
  • Flush wp rewrite rules.
  • Deactivate all plugins.
  • Remove all functions that may create a redirection loop and activate one by one until I found it.

本文标签: loginurl filter creates permanent wpadmin gt wplogin redirection loop