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

Reply To: Peepso Avatars

#25789
Ernest MarcinkoErnest Marcinko
Keymaster

Hi,

I assume you are reffering to User results? In that case, there was a very similar issue, and it turned out that there was something with PeepSo not hooking to the correct function or something like that. You can check the whole discussion here.

Anyways, we managed to come up with a small custom code snippet that seemingly worked at the time, you can try that as well. Try adding this custom code to the functions.php in your theme/child theme directory. Before editing, please make sure to have a full site back-up just in case!

add_filter('asp_results', 'asp_peepso_avatar_fix', 10, 1);
function asp_peepso_avatar_fix($results) {
	foreach ($results as &$r) {
		if ( $r->content_type == 'user' ) {
			$hash = get_user_meta($r->id, 'peepso_avatar_hash', true);
			if ( !empty($hash) ) {
				$r->image = get_site_url() . '/wp-content/peepso/users/' . $r->id . '/' . $hash . '-avatar-full.jpg';
			}
		}
	}
	return $results;
}