Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Use of users custom fields in a product search › Reply To: Use of users custom fields in a product search
May 7, 2020 at 7:50 am
#27155
Keymaster
That is actually very helpful. Maybe this variation:
add_filter( 'asp_results', 'asp_custom_images_gr', 10, 4 );
function asp_custom_images_gr( $results, $id, $is_ajax, $args ) {
global $WCFM, $WCFMmp;
foreach ($results as $k=>&$r) {
if ( $r->content_type == 'user' ) {
$store_user = wcfmmp_get_store( $r->id );
$r->image = $store_user->get_avatar();
}
}
return $results;
}