# Accessing Discourse user avatar in WP functions.php

**URL:** <https://meta.discourse.org/t/accessing-discourse-user-avatar-in-wp-functions-php/95390>\
**Category:** WordPress\
**Created:** [22.Август.2018 09:47:58 UTC](https://meta.discourse.org/t/accessing-discourse-user-avatar-in-wp-functions-php/95390 "2018-08-22T09:47:58Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [04.Сентябрь.2018 18:53:51 UTC](https://meta.discourse.org/t/accessing-discourse-user-avatar-in-wp-functions-php/95390/2 "2018-09-04T18:53:51Z")

</div>

Sorry for the delayed response to this. The [WP Discourse](https://github.com/discourse/wp-discourse) plugin doesn’t save the Discourse user’s avatar URL. When it displays avatars in comments, it uses the avatar URL that is returned from Discourse with the comments, and sources the avatar from the Discourse site.

Later this week, I’ll be updating the plugin to add a few extra [hooks](https://codex.wordpress.org/Plugin_API). If you are using your WordPress site as either the SSO provider, or the SSO client for Discourse, there will be a hook added that you could use to save the users `avatar_url` as user metadata on WordPress. You could then retrieve the avatar URL with

`get_user_meta( $user_id, 'your_field_name' );`

You would need to write the WordPress code to make use of the `avatar_url`. If this would be useful for you, I can give you some more details about it.

---

_[View the full topic](https://meta.discourse.org/t/accessing-discourse-user-avatar-in-wp-functions-php/95390)._
