public function getUserRoles($user_id)
    {
        $roles = array();

        foreach ((array) get_sites() as $site) {

            //Get user role
            if ($site->blog_id != 1) {
                $userSettings = get_user_meta($user_id, $this->db->prefix . $site->blog_id . '_capabilities', true);
            } else {
                $userSettings = get_user_meta($user_id, $this->db->prefix . 'capabilities', true);
            }

            //Store to settings array
            if (is_array($userSettings)) {
                $roles[$site->blog_id] = key($userSettings);
            } else {
                $roles[$site->blog_id] = false;
            }
        }

        return $roles;
    }
public function getUserRoles($user_id)
    {
        $roles = array();

        foreach ((array) get_sites() as $site) {

            //Get user role
            if ($site->blog_id != 1) {
                $userSettings = get_user_meta($user_id, $this->db->prefix . $site->blog_id . '_capabilities', true);
            } else {
                $userSettings = get_user_meta($user_id, $this->db->prefix . 'capabilities', true);
            }

            //Store to settings array
            if (is_array($userSettings)) {
                $roles[$site->blog_id] = key($userSettings);
            } else {
                $roles[$site->blog_id] = false;
            }
        }

        return $roles;
    }
public function getUserRoles ( $ user_id ) { $ roles = array ( ) ; foreach ( ( array ) get_sites ( ) as $ site ) { //Get user role if ( $ site -> blog_id != 1 ) { $ userSettings = get_user_meta ( $ user_id , $ this -> db -> prefix . $ site -> blog_id . '_capabilities' , true ) ; } else { $ userSettings = get_user_meta ( $ user_id , $ this -> db -> prefix . 'capabilities' , true ) ; } //Store to settings array if ( is_array ( $ userSettings ) ) { $ roles [ $ site -> blog_id ] = key ( $ userSettings ) ; } else { $ roles [ $ site -> blog_id ] = false ; } } return $ roles ; }
Get roles that are defined at each site
@return array
Get roles that are defined at each site