Tagged: echo xprofile fields
hi, i am trying to echo a xprofile field tha is a Multi select box. i am using one of your solutions givenin here: https://buddydev.com/fetching-and-showing-only-specific-fields-from-buddypress-xprofile-data/#comment-3439
‘echo bp_unserialize_profile_field( xprofile_get_field_data( ‘CheckboxFieldName’, get_the_author_id()) ) );’
the only result i get is “Array”. the ocde works fine when normal fields are echoed.
I hope you can find time to help me.
- Brajesh Singh on March 31, 2019 at 4:14 am #21773
You can use this instead
xprofile_get_field_data( 'CheckboxFieldName', get_the_author_id(), 'comma' );
Also, there is no need to use bp_unserialize_profile_field(). BuddyPress does that automatically for you when you use xprofile_get_field_data.
Please let me know if it works for you or not?
- Brajesh Singh on April 1, 2019 at 5:57 pm #21784
You are welcome.
The topic ‘ [Resolved] echo Multi select boxes -> array’ is closed to new replies.