Redirect users to their blogs homepage

Hi, this is really a continuation of the same question posed a couple of months ago, but is now closed.

https://premium.wpmudev.org/forums/topic/how-to-make-login-redirect-take-users-to-their-blogs-homepage

In the last thread, David came up with a solution:

function login_site_redirect ( $redirect_to ) {

global $user;

$primary_blog_id = get_usermeta($user->ID, ‘primary_blog’:wink:;

$blog_details = get_blog_details($primary_blog_id);

$redirect_url = $blog_details->siteurl;

return $redirect_url;

}

add_filter ( ‘login_redirect’, ‘login_site_redirect’, 10, 3 ) ;

I tried adding this to my functions.php but it had no effect. Questions:

1. Did it need to be in a specific place in the functions.php file?

2. Does it need another closing tag after the last semi-colon?

3. Is the primary blog established when a user signs up for a new site? Or do I need to change sign-up to establish this?

4. My site owners are set-up as editors (should that matter) on their sites and subscribers on the main site?

5. When this works will it take them to their front-end or back-end dashboard?