• Resolved Coach Afrane

    (@coach-afrane)


    Hi,
    After updating TML, “redirect to user profile’ code snippet is no more redirecting to user profile.
    It works when I deactivate TML, but it’s helpful to use.

    I am using a multisite and I have TML activated on the subsite. That is where I want the redirect to profile to happen.

    Any help, please?

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Jeff Farthing

    (@jfarthing84)

    Which “snippet” are you talking about?

    Thread Starter Coach Afrane

    (@coach-afrane)

    Thanks.
    I was referring to this code.

    add_filter( 'bp_login_redirect', 'bpdev_redirect_to_profile', 11, 3 );
     
    function bpdev_redirect_to_profile( $redirect_to_calculated, $redirect_url_specified, $user ){
    
    	if( empty( $redirect_to_calculated ) )
    		$redirect_to_calculated = admin_url();
     
    	//if the user is not site admin,redirect to his/her profile
    
    	if( isset( $user->ID) && ! is_super_admin( $user->ID ) )
    		return bp_core_get_user_domain( $user->ID );
    	else
    		return $redirect_to_calculated; /*if site admin or not logged in, do not do anything*/
     
    }
    Plugin Author Jeff Farthing

    (@jfarthing84)

    Change this:

    
    if( isset( $user->ID) && ! is_super_admin( $user->ID ) )
    

    To this:

    
    if ( ! is_wp_error( $user ) && ! is_super_admin( $user->ID ) )
    
    Thread Starter Coach Afrane

    (@coach-afrane)

    Thanks a lot, but the problem still exists.
    The change didn’t work.

    Any more action to take?

    Plugin Author Jeff Farthing

    (@jfarthing84)

    I don’t see any reason that shouldn’t work.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Login not redirecting to user profile after update’ is closed to new replies.