In the site I am building, I'm using "theme my plugin" so I could make my own login, logout, registration pages.
For the login form, I used the default wp_login_form
input names, and the default value for the hidden type input named redirect_to
which is: ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']
.
for some pages, I want user to login to access to them, so I use the auth_redirect()
function, as expected it sends users to the login page, but after login, doesn't send them back to the page they were originally.
So I tried to filter the login_redirect
... but it doesn't work. Thanks for your help!
function my_login_redirect_function(){
if(( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] == get_bloginfo('url').'/login'){
return get_bloginfo('url').'/dashboard';
}else{
$urlStartPos= strstr($_SERVER['REQUEST_URI'], 'http');
return(urldecode($urlStartPos));
}
add_filter('login_redirect','my_login_redirect_function');
redirect_to
get parameter, but there's nothing here that reads that, and it's unclear how this plugin is meant to handle the redirect. Have you asked theme my login support? 3rd party plugin dev support is offtopic here, and what would work in normal WP may not work for you, any answer you get here may not apply to theme my login