Hello great team:)
I have a checkbox field called ‘Roles’ with 3 checkboxes that have titles ‘Music’ , ‘Movies’ , ‘Food’.
I would like to create some if statement according to what the user checked.
I saw from https://buddydev.com/fetching-and-showing-only-specific-fields-from-buddypress-xprofile-data/ that i can use$data = bp_get_member_profile_data( array( 'field'=>'CheckBox Or Select Field Name','user_id' => $user_id ) );echo $data;
to fetch the data, but this returns all data in an array.Could you please help me create an if statement like
if user with $user_id checked the checkbox 'Music' from checkbox field called 'Roles'
because i can’t figure it out.As i saw here https://buddypress.org/support/topic/buddypress-checkbox-field-data/ the data in the database are in a form of a serialized array.
Thank you very much for your time and help
The topic ‘ [Resolved] Fetch and condition for checkboxes data values’ is closed to new replies.