Skip to:
Content
Pages
Categories
Search
Top
Bottom

redirect after login

Viewing 2 replies - 1 through 2 (of 2 total)

  • shanebp
    Moderator

    @shanebp

    Try:

    function custom_login_redirect_to($user_login, $user) {
    
    	bp_core_redirect( get_option('siteurl') . '/members/'  . $user_login );
    }
    add_action('wp_login', 'custom_login_redirect_to', 10, 2);

    _natty_
    Participant

    @_natty_

    @shanebp
    it seems thats works for every users but not for the admin!
    the url thats work for the admin is: site/members/admin instead of site/members/admin username i wonder why!

    thats work, but to me is silly:

    function custom_login_redirect_to($user_login, $user) {
    
    	if($user_login=='breakAdmin'){
    			bp_core_redirect( get_option('siteurl') . '/members/admin' );
    
    	}
    
    	bp_core_redirect( get_option('siteurl') . '/members/'  . $user_login );
    }
    add_action('wp_login', 'custom_login_redirect_to', 10, 2);
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar