How to link wordpress avatars with discourse?

@simon thanks again for the help.

Where should I put this filter in my discourse forum? Is there a specific place within my discourse admin settings where I should copy/paste this code?

add_filter( 'wpdc_sso_avatar_url', 'my_namespace_use_custom_avatar', 10, 2 );

function my_namespace_use_custom_avatar( $avatar_url, $user_id ) {
    if ( get_user_meta( $user_id, 'custom_field_1', true ) ) {
        $avatar_url = get_user_meta( $user_id, 'custom_field_1', true );
    }

    return $avatar_url;
}