• Resolved Michele Mizejewski

    (@mizejewski)


    Please see this GitHub issue for a fuller explanation. https://github.com/pojome/elementor/issues/3757

    Hoping you can patch your plugin making the addition of a snippet unnecessary.

    The Author Box widget (in the Elementor pagebuilder plugin) uses the native WordPress get_avatar_url function which WP User Avatar fails to filter like it does to all other native WordPress avatar related functions.

    Luckily this is a simple fix which you can place in your functions.php, or even better, suggest it to the plugin author:

    
    add_filter( 'get_avatar_url', function( $url, $id_or_email, $args ){
    	if ( is_email( $id_or_email ) ) {
    		$user = get_user_by( 'email', $id_or_email );
    		$user_id = $user->ID;
    	} else {
    		$user_id = $id_or_email;
    	}
    	if ( has_wp_user_avatar( $user_id ) ) {
        	return get_wp_user_avatar_src( $user_id );
    	}
    	return $url;
    }, 10, 3);
    
  • The topic ‘Elementor and the get_avatar_url function’ is closed to new replies.