Login Redirect Structure Issue
-
Hello,
I’m having an issue since the last update to version 2.8.4
We’re using the following in functions.php to redirect all users to the /login-register page where we use the profile builder login. This is so that users, unless admin, cannot access wp-login.php or wp-admin URLs
add_filter('login_url', 'your_login_url', 10, 2 ); add_action('login_init', 'your_login_page'); add_action('wp_login', 'your_login_redirect', 10, 2); // // assuming that your new front end login url is "/login-register", use this: function your_login_url($login_url, $redirect) { return home_url('/login-register'); } function your_login_page() { wp_redirect(home_url('/login-register'), 302); } // if admin send them to the dashboard, otherwise leave them on the frontend function your_login_redirect($user_login, $user) { if (current_user_can('activate_plugins')) { wp_redirect('/wp-admin/index.php', 302); } else { $url = home_url('/login-register/'); } } return;Worked great, until update. After update, even admins cannot access any wp-admin pages, we’re simply getting redirected back to /login-register???
If I comment outadd_action('login_init', 'your_login_page');I can access the admin area, but then it actually seems to direct to wp-login.php after logging in through profile builder.On our site, I’ve rolled back profile builder to version 2.8.3 so that it continues to work as I would like. I’m just wondering what the reason is for this, and how I can update without having this issue.
Thanks!
The page I need help with: [log in to see the link]
The topic ‘Login Redirect Structure Issue’ is closed to new replies.