Skip to content
This repository has been archived by the owner on Sep 24, 2018. It is now read-only.

Return an array of avatar urls in different sizes for Comments and Users #1361

Merged
merged 11 commits into from
Jun 22, 2015

Conversation

rachelbaker
Copy link
Member

  • Add rest_get_avatars and deprecate rest_get_avatar
  • Update Comment controller to use rest_get_avatars
  • Update Users controller to use rest_get_avatars

@rachelbaker rachelbaker added this to the 2.0 Beta 3 milestone Jun 19, 2015
@rachelbaker
Copy link
Member Author

Fixes #1330 and #1290

We now return an array of avatar urls that are keyed on the image size. This approach is the result of a discussion with @rmccue via the #core-rest-api Slack channel earlier this week.

Example:

  "avatar_urls": {
    "24": "http://0.gravatar.com/avatar/06e92fdf4a9a63441dff65945114b47f?s=24&d=mm&r=g",
    "48": "http://0.gravatar.com/avatar/06e92fdf4a9a63441dff65945114b47f?s=48&d=mm&r=g",
    "96": "http://0.gravatar.com/avatar/06e92fdf4a9a63441dff65945114b47f?s=96&d=mm&r=g"
  },

'type' => 'string',
'author_avatar_urls' => array(
'description' => 'Avatar URLs for the object author.',
'type' => 'array',
'format' => 'uri',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danielbachhuber can I still use the uri format with the array type?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're actually returning an object now, so it would be an object with specific properties

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

@rachelbaker
Copy link
Member Author

@WP-API/amigos #reviewmerge

@rachelbaker
Copy link
Member Author

Hold off on a merge, I need to fix the schema.

@rachelbaker rachelbaker modified the milestones: 2.0 Beta 4, 2.0 Beta 3 Jun 21, 2015
@rachelbaker
Copy link
Member Author

@WP-API/amigos #reviewmerge

@rmccue
Copy link
Member

rmccue commented Jun 22, 2015

👍

rmccue added a commit that referenced this pull request Jun 22, 2015
Return an array of avatar urls in different sizes for Comments and Users
@rmccue rmccue merged commit bb48c33 into develop Jun 22, 2015
@rmccue rmccue deleted the fix-1330 branch June 22, 2015 03:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants