Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)

  • tkuron
    Participant

    @tkuron

    I managed to fix the issue.

    Apparently BuddyPress does not change the avatar url when get_avatar_data() -function is called. I managed to fix the issue by adding following piece of script to my plugin’s source code:

    <?php
    add_filter("get_avatar_data", function($args, $id_or_email){
    	$bp_avatar_url = bp_core_fetch_avatar([
    			"html" => false,
    			"item_id" => $id,
    			"type" => "full",
    			"width" => $args["size"],
    			"height" => $args["size"]
    	]);
    	
    	$bp_avatar_url = htmlspecialchars_decode($bp_avatar_url);
    	$args["url"] = $bp_avatar_url;
    			
    	return $args;
    }, 10, 2);
    ?>

    tkuron
    Participant

    @tkuron

    That does not seems to help me with this issue… I still get the Gravater image. I don’t have a foggiest idea why it does do that on my plugin.

Viewing 2 replies - 1 through 2 (of 2 total)
Skip to toolbar