# User avatar preference spontaneously changing to "Custom picture"

**URL:** <https://meta.discourse.org/t/user-avatar-preference-spontaneously-changing-to-custom-picture/56977>\
**Category:** WordPress\
**Created:** [Fevereiro 6, 2017, 2:34pm UTC](https://meta.discourse.org/t/user-avatar-preference-spontaneously-changing-to-custom-picture/56977 "2017-02-06T14:34:09Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)\
**Post date:** [Março 22, 2017, 4:46pm UTC](https://meta.discourse.org/t/user-avatar-preference-spontaneously-changing-to-custom-picture/56977/9 "2017-03-22T16:46:37Z")

</div>

It’s still sending the avatar\_url, but setting the default to 404:

```plaintext
	protected function get_avatar_url( $user_id ) {
		$avatar_url = get_avatar_url( $user_id, array(
			'default' => '404',
		) );

		return apply_filters( 'wpdc_sso_avatar_url', $avatar_url, $user_id );
	}

```

If a user has a Gravatar, Discourse will use it. If they don’t have an gravatar associated with their email address, they should now be getting the Discourse default avatar.

It seems that even if an avatar URL isn’t sent to Discourse, if there is a gravatar associated with the user’s email, Discourse will find and use it.

---

_[View the full topic](https://meta.discourse.org/t/user-avatar-preference-spontaneously-changing-to-custom-picture/56977)._
