Peepso Avatars

This topic contains 2 replies, has 2 voices, and was last updated by JustinJon3s JustinJon3s 4 years, 2 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #25777
    JustinJon3s
    JustinJon3s
    Participant

    Do you have a way for peepso avatars to show up in search results? The settings are selected as per the documentation.

    #25789
    Ernest Marcinko
    Ernest 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;
    }
    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #25791
    JustinJon3s
    JustinJon3s
    Participant

    Thank you! That worked!

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Peepso Avatars’ is closed to new replies.