This site has a custom post type for members. Each member has a profile page and has a user account so they can edit their own information. Now, the client wants a user (member) to be redirected to their own profile page (which is the only post they can manage) after login.
- There's a custom post type called "members".
- Each member has his own WordPress user account.
- Each member is set as the author for his own member post.
- Each user can only edit his own member info.
What we want is that when the user logs in, he will be redirected to his own member post.
I know I can use redirect plugins, but how can I redirect the user to his own member post instead of a static URL? It's not like there's a /my-account URL that I can redirect to, since each member post has a unique URL (site.nl/member/[member-name]).
Well - for that, you can use the WordPress native filter "login_redirect" where we can try to find the member post where author of member post will be current loggedin useer and if found we will try to redirect user to that found member post.