Great, so you want to do the following
use WPDiscourse\Utilities\Utilities as DiscourseUtilities;
add_action("um_after_upload_db_meta_profile_photo", "um_custom_after_upload_profile_photo", 10, 1 );
function um_custom_after_upload_profile_photo( $user_id ){
$avatar_url = // Ultimate Member avatar URL
$params = array(
'external_id' => $user_id,
'avatar_url' => $avatar_url,
'avatar_force_update' => 'true'
)
DiscourseUtilities::sync_sso_record( $params, $user_id );
}
You’ll need to figure out the URL for the avatar on Wordpress (you’ll perhaps find this in the Ultimate Member documentation) and set that to the variable $avatar_url.