display only the list of members who match with a search criterion
-
Hello,
The idea is to display only the list of members who match with a search criterion “radio button” (or if possible checkbox) that inserted the logged in member in his profile (eg I am looking for a : developer=”buddypress” 🙂
I found the following function but how to add filter on the display of the list of members in bp-custom.php?
function my_custom_ids( $field_name, $field_value = '' ) { if ( empty( $field_name ) ) return ''; global $wpdb; $field_id = xprofile_get_field_id_from_name( $field_name ); if ( !empty( $field_id ) ) $query = "SELECT user_id FROM " . $wpdb->prefix . "bp_xprofile_data WHERE field_id = " . $field_id; else return ''; if ( $field_value != '' ) $query .= " AND value LIKE '%" . $field_value . "%'"; /* LIKE is slow. If you're sure the value has not been serialized, you can do this: $query .= " AND value = '" . $field_value . "'"; */ $custom_ids = $wpdb->get_col( $query ); if ( !empty( $custom_ids ) ) { // convert the array to a csv string $custom_ids_str = 'include=' . implode(",", $custom_ids); return $custom_ids_str; } else return ''; }
Regards
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- You must be logged in to reply to this topic.