get_avatar is parsing with current host url (1 post)

  1. dcarmo
    Posted 4 years ago #

    Hello everyone,

    I am trying to get the avatar of people who post a comment on my post and send it back through a JSON object. The user hits a URL with specific parameters and the URL returns the JSON object.

    My problem is with the get_avatar function. The URL that it is returning is hostname + path + gravatarURL. The hostname and path is the origional site that they hit to make the API call.

    To get the avatar I just iterate through all the comments and add to each comment my own avatar item.

    $comment_with_avatar = null;
    foreach($comments as $comment)
    $comment_with_avatar[] = array (

    the comments all print fine, but the avatar from the site comes back blank and the url is encoded and in the format explained above. For example


Topic Closed

This topic has been closed to new replies.

About this Topic