So first – to display inside search results users info like name, email, website and bio please use following code snippet
add_filter( 'aws_search_users_results', 'my_aws_search_users_results', 10, 3 );
function my_aws_search_users_results( $results, $roles, $search_query ) {
if ( $results ) {
foreach( $results as $user_id => $user ) {
$excerpt = '';
$user_info = get_userdata($user_id);
$userdata = get_user_meta( $user_id );
if ( $userdata && isset( $userdata['description'] ) ) {
$excerpt .= $userdata['description'][0];
}
if ( $user_info && $user_info->user_email ) {
$excerpt .= '<br>Email - ' . $user_info->user_email;
}
if ( $user_info && $user_info->user_url ) {
$excerpt .= '<br>Website - ' . $user_info->user_url;
}
$results[$user_id][0]['excerpt'] = $excerpt;
}
}
return $results;
}
About searching for different user roles – this can be done in the following way:
Create different search form instances with different options for user roles search. One – for searching for dealers
. Second – for craftsmans
search. Than add both of this two search forms on the needed places of your site.