• Hi folks,
    Having trouble with an usefull and comon function.
    I always worked with it but now it does’nt any more.

    add_action( 'login_redirect', 'redirect_on_login' );
    function redirect_on_login() {
    	get_currentuserinfo();
    	$role = $current_user->user_level;
    	if  ($role == '0')
    			wp_redirect(home_url());
    		else
    			return;
    }

    Whenever I am arriving in wp_login.php I am redirected directly on homepage.
    the thing is that I do want to redirect only AFTER submit form !!
    any tips please ??
    (do not want to use a plugin just for that)
    thanks
    cheers

  • The topic ‘Redirect after submit login_form, not before’ is closed to new replies.