-
Notifications
You must be signed in to change notification settings - Fork 651
Limit the Users response fields in the embed context #1251
Conversation
Changed the following fields to only display in the view or edit contexts: - first_name - last_name - slug - url - description - nickname
|
Fixes #417 @WP-API/amigos #reviewmerge |
|
Why are you removing |
@danielbachhuber because those details aren't always publically available. Some themes expose them, but we shouldn't assume all sites want that data public. |
I thought we decided in NYC that we'd be exposing the data? |
This follows the logic laid out in #417.
|
@danielbachhuber You are right, confirmed with the logic laid out in #417 and corrected in dbfe9e7 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't slug exposed in the URL?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And by URL I mean link
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@danielbachhuber It is exposed in the author url. slug also defaults to the user_login so I don't see a reason to expose it in the embedded response.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
slug also defaults to the user_login so I don't see a reason to expose it in the embedded response.
Why not? Most other resources all have slug: Post, Term
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@danielbachhuber Is there a use case for having the Users slug without authentication? Keeping in mind that get_author_posts_url() is filterable to not use user_nicename (or slug)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a use case for having the Users slug without authentication?
Consistency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel very strongly that slug is a User field I would not expect to be available in the embed context. The field is available in the view and edit context.
Is there a reason besides consistency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason besides consistency?
Not at the top of my head, but I'm sleep deprived.
We can just see if it comes up again.
Limit the Users response fields in the embed context
Changed the following fields to only display in the view or edit contexts:
- first_name
- last_name
- slug
- nickname
Includes test coverage.
The
embedcontext now only includes the following response fields:avatar_urlidlinknameurldescription