admin管理员组文章数量:1279090
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');
本文标签: filtersauthredirect() doesn39t send users to the page where they orginally tried to acces
版权声明:本文标题:filters - auth_redirect() doesn't send users to the page where they orginally tried to acces 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741253902a2366304.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论