Repository navigation
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.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 wasn't sure about this and that's why I hadn't included it in my main author field PR.
Can't a subscriber upload an attachment and be set as author of it?
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.
Good questions!
For WordPress attachment post types, I'm pretty sure the author is the user who uploaded the file to the WordPress media library.
By default, no — subscribers cannot upload files in WordPress. The standard capability required to upload files is
upload_files, which subscribers don't have.Now, something that I didn't notice, but should have, is that contributors don't have
upload_filescaps by default either.In fact, that makes me wonder if we should be rather be querying by roles cap instead for perfect accuracy, but I'm not sure that's possible.
{ who: 'authors' }is not perfectly aligned withupload_files, it's the closest we have and probably fits most cases.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.
It seems we can query by caps. Said that, it seems there are more nuances in the query (at least for the pages one). Not sure if attachments are affected the same way.