0

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.com/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.

0

You 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.