-
anjanphukan replied to the topic Filter members based on checkbox type custom field in the forum How-to & Troubleshooting 2 years, 8 months ago
I am using BP_User_Query and BP_Xprofile_Queury with the following code and it worked for me now.
$xprofile_query = array( 'relation' => 'OR');
foreach ($my_items as $key => $value) {
$xprofile_query[] = array(
'key'=> $fieldID,
'value' => $value,
'compare' => 'LIKE'
);
}$args = array(
'member_type' => 'donor',
);if…[Read more]
-
anjanphukan replied to the topic Filter members based on checkbox type custom field in the forum How-to & Troubleshooting 2 years, 8 months ago
Thank you so much @shanebp.
But I am a little bit worried as this may bring up the results for the items named – “tested”, “pre-test”, “untest”, “not tested”, etc. if I try to filter the items named only “test”.
Any suggestions?
Regards.
-
anjanphukan replied to the topic Filter members based on checkbox type custom field in the forum How-to & Troubleshooting 2 years, 8 months ago
Sure no problem. So here is my scenario.
There are 2 member types and I have a custom user field created, let’s called it Items.
Both member types need to select some of those Item checkboxes. Now I need to show the oposite member types with common Items on a member profile. For that I created a custom page and run the Members loop. I was able…[Read more]
-
anjanphukan replied to the topic Filter members based on checkbox type custom field in the forum How-to & Troubleshooting 2 years, 8 months ago
-
anjanphukan started the topic Filter members based on checkbox type custom field in the forum How-to & Troubleshooting 2 years, 8 months ago
How to use
bp_has_members()
function to filter members based on a custom field which is a set of checkboxes?
I think checkbox values are stored as array in database.
my_custom_ids()
function in Members Loop works only with single value. But it doesn’t work with array of checkboxes.Thank you.
@anjanphukan
Active 5 months ago