Get value of profile field

Get value of profile field

by Thom Olden -
Number of replies: 2

Hi all,

I'm trying to get the value of the profile fields Institution and Department so I can display them in a block. But I can't figure out how to do it. I only found discussions on how to get the value of a custom field. I did manage to get that working, but that is not what i'm looking for. Profile_display_fields($USER->id) only shows my custom made field. I've no idea how to access the Institution and Department field.

I'm hoping someone here can help me out.

Thanks in advance.

Average of ratings: -
In reply to Thom Olden

Re: Get value of profile field

by Sam Chaffee -
Picture of Core developers

If you need them for the currently logged in user they are properties on the global $USER variable, i.e. $USER->institution and $USER->department.

If you need them for other users you can query them out of the user table.