Editor: Use getAuthors for 'showCombobox' check #30218
Merged
Conversation
Mmmm Right, this makes sense. cc @adamsilverstein Should we add a comment explaining the reasoning there? |
Thanks, @youknowriad, for the review.
Agree, make it easier to avoid similar regression in the future. I will update the code and add the comment. |
37f8b71
to
c521664
gziolo
added a commit
that referenced
this pull request
Apr 6, 2021
* Use getAuthors for 'showCombobox' check * Add inline comment
gziolo
added a commit
that referenced
this pull request
Apr 6, 2021
* revert #27717 (#30524) Co-authored-by: grzim <[email protected]> * Use getAuthors for 'showCombobox' check (#30218) * Use getAuthors for 'showCombobox' check * Add inline comment * Gallery: Set 'addToGallery' prop to false when images don't have IDs. (#30122) This also sets MediaPlaceholder value to an empty object. With both props set to "falsy" values, the gallery media frame is initialized in the "Create Gallery" state. This lets users replace placeholder images from patterns. Co-authored-by: Grzegorz <[email protected]> Co-authored-by: grzim <[email protected]> Co-authored-by: George Mamadashvili <[email protected]>
ntsekouras
added a commit
that referenced
this pull request
Apr 7, 2021
* revert #27717 (#30524) Co-authored-by: grzim <[email protected]> * Use getAuthors for 'showCombobox' check (#30218) * Use getAuthors for 'showCombobox' check * Add inline comment * Gallery: Set 'addToGallery' prop to false when images don't have IDs. (#30122) This also sets MediaPlaceholder value to an empty object. With both props set to "falsy" values, the gallery media frame is initialized in the "Create Gallery" state. This lets users replace placeholder images from patterns. Co-authored-by: Grzegorz <[email protected]> Co-authored-by: grzim <[email protected]> Co-authored-by: George Mamadashvili <[email protected]>
Nice! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Description
The
getUsers
automatically addscontext=edit
which requires for the current user to havelist_users
capability.Fixes #29845.
How has this been tested?
Test A:
403 Forbidden
error in the browser console for this endpoint -https://<site_url>/wp-json/wp/v2/users?who=authors&per_page=26&context=edit&_locale=user
.Test B:
wp user generate --role=editor --count=50
Cleanup:
wp user delete $(wp user list --role=editor --field=ID)
.Types of changes
Bugfix
Checklist: