MyBB Community Forums

Full Version: Is there a way to get $userfields data from UCP?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is there a way to get $userfields data from UCP? 

$userfields['fidX'] can be used to display the value of a custom field for that user from their profile or post. I want to display some text in their UCP>Profile settings depending on the value of $userfields['fidX'], but $userfields doesn't seem to exist in scope of UCP. Is there a way to grab that data?
I believe $post['customfield'] should work, have a look at https://docs.mybb.com/1.6/Admin-CP-Confi...le-Fields/
They have an example <br />Custom Profile Field: {$post['fidX']}

Similar question: https://community.mybb.com/thread-213825.html
Doesn't work. Both those topics are adding the custom field to postbit, which isn't used in UCP.
Try this {$mybb->user['fid4']} replace 4 with the actual field ID.

Tested and working locally Wink
That one worked, thanks a bunch!