Hello, I hope someone can help me with this.
I’m using the WordPress discourse plugin with WordPress as my SSO provider. I’m trying to set the avatar_ur
l from a custom user meta field populated with a gravity form.
When I view the logs I can see that the correct avatar_url
is coming in with the payload.
Here is the function I’m using to insert the avatar_url
into the SSO payload. I’ve also tried using the wpdc_sso_params filter with the same results.
add_filter( 'wpdc_sso_avatar_url', 'gn_use_custom_avatar', 10, 2 );
function gn_use_custom_avatar( $avatar_url, $user_id ) {
if ( get_user_meta( $user_id, 'user_avatar', true ) ) {
$avatar_url = get_user_meta( $user_id, 'user_avatar', true );
}
return $avatar_url;
}
Stranger still, if I set the $avatar_ur
l to a random image hosted on another site I will see the avatar image update.
I’ve tried using the curl command from my discourse’s docker instance on the avatar URL in the user’s meta and I’m not getting any errors. So, I’m at a loss at how to proceed.
Any idea?