• Hi

    I have a number of fields that users can search:
    – name
    – primary skill
    – secondary skills

    The primary and secondary skills are drop down select boxes.

    Is there anyway to have a single input box on the front end that users can search? I don’t really want them to have to type in text and then select from two drop downs.

    https://ww.wp.xz.cn/plugins/bp-profile-search/

Viewing 1 replies (of 1 total)
  • Plugin Author Andrea Tarantini

    (@dontdream)

    Try adding this code:

    add_filter ('bps_field_sql', 'multi_search', 10, 2);
    function multi_search ($sql, $field)
    {
    global $bp;
    
    if ($field->id == 10)
    	$sql = "SELECT user_id FROM {$bp->profile->table_name_data} WHERE field_id IN (10,20) ";
    
    return $sql;
    }

    Replace 10 with the field ID of ‘Primary Skill’ and 20 with the field ID of ‘Secondary Skill’.

Viewing 1 replies (of 1 total)

The topic ‘Search multiple profile fields with a single input box’ is closed to new replies.