WordPress.org

Ready to get started?Download WordPress

Forums

Active Directory Integration
[resolved] Bad redirection at the first login (3 posts)

  1. jcorriveau
    Member
    Posted 1 year ago #

    When a user is trying to login for the first time, he is always redirect to his profile. Is it possible to just redirect the user to the frontend home page?

    http://wordpress.org/extend/plugins/active-directory-integration/

  2. T Klein
    Member
    Posted 1 year ago #

    Use this in functions.php:

    // redirect the users on login to the homepage (otherwise they go to the profile page, you don't want that)
    add_filter( 'login_redirect', 'my_login_redirect', 10, 3 );
    function my_login_redirect( $redirect_to, $request, $user ) {
        // Is there a user?
        if ( is_array( $user->roles ) ) {
            // Is it an administrator?
            if ( in_array( 'administrator', $user->roles ) )
                return home_url( '/wp-admin/' );
            else
                return home_url();
                // return get_permalink( 83 );
        }
    }
  3. glatze
    Member
    Plugin Author

    Posted 1 year ago #

    You can try the plugin "Peters's Login Redirect": http://wordpress.org/extend/plugins/peters-login-redirect/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.