This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: How to add image source into a custom field?

Home Forums Product Support Forums Ajax Search Pro for WordPress Support How to add image source into a custom field? Reply To: How to add image source into a custom field?

#32550
Ernest MarcinkoErnest Marcinko
Keymaster

Try this variation, maybe this one:

add_filter('asp_results', 'asp_results_add_custom_image', 10, 1);
function asp_results_add_custom_image($results) {
	foreach ( $results as $k => &$r ) {
		if ( isset($r->taxonomy) ) {
			$vendor = yith_get_vendor( $r->id, 'vendor' );
			$r->image = wp_get_attachment_image_src( 
				$vendor->avatar, 
				apply_filters( 'yith_wcmv_get_avatar_size', YITH_Vendors()->get_image_size( 'gravatar' ) )  
			);
		}
	}
	
	return $results;
}