Skip Navigation

[Resolved] Access User Profile Custom Fields for a specific user id

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 7 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 5 replies, has 2 voices.

Last updated by nathanw-6 7 years, 3 months ago.

Assisted by: Shane.

Author
Posts
#478904

I am trying to read custom user profile checkboxes data for different users from PHP but just can't see a way of doing this.

#478940

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Nathan,

Thank you for contacting our support forum.

You want to use php to get the user info from a user custom field correct?

This is known as the user meta and you will need to use this function
https://codex.wordpress.org/Function_Reference/get_user_meta

Please let me know if this helps.
Thanks,
Shane

#478941

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Also if I misinterpret the issue please let me know.

Providing an example will also help me to understand better.

Thanks,
Shane

#478944

Hi Shane, I understand that about using the get user meta but not sure about the "checkboxes" as this appears to be a serialised data type. Will this come back as an array that can be parsed for the multiple checkboxes and the states of each?

#478968

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Nathan,

The checkboxes would return as an Array so you will need to slice off the section of the array value that you want.

Thanks,
Shane

#479351

Hi Shane, I have done what you suggested but the returned array is impossible to decode. Below is the result of the array.

array(1) { [0]=> array(4) { ["wpcf-fields-checkboxes-option-c584e1b689f99efc3554ab9836ceb598-1"]=> array(1) { [0]=> string(1) "1" } ["wpcf-fields-checkboxes-option-6be0bd7cc6af74f84469370319eb3bc3-1"]=> array(1) { [0]=> string(1) "1" } ["wpcf-fields-checkboxes-option-b6f87ce47d3025f5e1a82f087cef6991-1"]=> int(0) ["wpcf-fields-checkboxes-option-1b0cea320ab689bfc41ec7aaa32f3845-1"]=> int(0) } }

The forum ‘Types Community Support’ is closed to new topics and replies.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.