admin管理员组文章数量:1325497
The subsite administrators of my multisite installation want to go directly to the subsite home page upon login, bypassing the dashboard. Irrespective of the wisdom of this, it's what they clearly want to do.
I have attempted to implement the suggestions found in the following two posts (among others) without success:
Multisite - Redirect All Users to Subsite Home Page on Subsite Login (including removing the "if (is_admin)" code ).
This seems like it should be straight-forward, but I am struggling. Any guidance would be most appreciated.
The subsite administrators of my multisite installation want to go directly to the subsite home page upon login, bypassing the dashboard. Irrespective of the wisdom of this, it's what they clearly want to do.
I have attempted to implement the suggestions found in the following two posts (among others) without success:
https://stackoverflow/questions/8127453/redirect-after-login-on-wordpress
Multisite - Redirect All Users to Subsite Home Page on Subsite Login (including removing the "if (is_admin)" code ).
This seems like it should be straight-forward, but I am struggling. Any guidance would be most appreciated.
Share Improve this question edited May 23, 2017 at 12:40 CommunityBot 1 asked Aug 25, 2014 at 18:26 mike31mike31 134 bronze badges1 Answer
Reset to default 0You can use the login_redirect
filter:
add_filter( 'login_redirect', 'wpse_159078_login_redirect' );
function wpse_159078_login_redirect( $redirect ) {
if( ! current_user_can( 'update_core' ) ) {
// if it's not a super admin that's logging in
$redirect = get_home_url();
}
return $redirect;
}
References
login_redirect
filterget_home_url()
本文标签: Multisite Redirect Subsite Administrator to Subsite Home PageBypassing Dashboard
版权声明:本文标题:Multisite: Redirect Subsite Administrator to Subsite Home Page, Bypassing Dashboard 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742197983a2431433.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论