Skip to:
Content
Pages
Categories
Search
Top
Bottom

Adding the users’ avatar photo URL to usermeta


  • aabell03
    Participant

    @aabell03

    Hi everyone,

    I’ve configured SSO from our WordPress instance to another platform. I’ve mapped out firstname, lastname, and email from the usermeta stored in our WordPress database.

    Since the user photo isn’t stored in usermeta by default, I tried writing a custom function, but it’s only displaying a blank gravatar photo placeholder. What do I need to adjust to pull the actual avatar of the user so I can pass it over?

    Here’s my code:
    update_user_meta( get_current_user_id(), 'user_photo_url', get_avatar_url( 'user_email' ) ) ;

Viewing 1 replies (of 1 total)

  • shanebp
    Moderator

    @shanebp

    It is unclear if this is a BuddyPress issue.
    BP does not store avatar info in the database.
    It calls avatars from the uploads > avatars directory and organizes them based on the WP user ID.

    See bp_core_fetch_avatar

    If not found, the default image is used.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar