Ad Code

Send Users to Account page in Wordpress after Login


Can anyone tell me why this isn't sending users to the account page after login? Yes, the auto-generated redirect_to hidden field has the correct absolute URL for the account page. It's just not going there.

$redirect = site_url('/account/');
wp_login_form(array('redirect' => $redirect));

It is sending the redirect to /wp-admin/ what i do 

I don't normally log in from the frontend, but I believe going to /wp-admin is the default functionality that I'm trying to override. Looking at the codex, I think I'm coding it properly

Try typing out your absolute URL as a string, rather than using the site_url function, just to rule it out. Are you using any other kind of login/user/member plugin that could be causing a conflict or might be superseding the login form's logic?

Typing the absolute URL as a string didn't work. I'm using WP User Front End Pro and Paid Membership Pro. I've searched both plugins for "wp_login_form" but am not getting any results. "redirect" gets too many results to look through. Do you know any other strings I could search for that may give me a clue if the redirect is being overridden somewhere?

So I think it had to do with the different roles. If a user is an "Administrator" role, it will always push them to /wp-admin/ if they are another role, you can control their redirect.

Reactions

Post a Comment

0 Comments