-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Featured Image: Allow authors to select images uploaded by other users #33567
Conversation
Size Change: +12 B (0%) Total Size: 1.07 MB
ℹ️ View Unchanged
|
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.
Thanks for your work @Mamaduka !
Two years of campaigning has finally concluded. If WordPress does not give me credit for the time I've spent to push this up... @Mamaduka Endless high-fives for resolving this issue. |
@@ -44,7 +44,13 @@ function PostFeaturedImageDisplay( { | |||
); | |||
const media = useSelect( | |||
( select ) => | |||
featuredImage && select( coreStore ).getMedia( featuredImage ), | |||
featuredImage && | |||
select( coreStore ).getEntityRecord( |
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.
@youknowriad, is it possible to pass additional params to getMedia
and other methods automatically generated from entities? One thing that surprises me is that I see getEntityRecord
used so often despite all these shorthand methods available:
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.
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.
@Mamaduka, it's optional. I was rather sharing a general thought about the surprising popularity of more verbose getEntityRecord
.
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.
@gziolo, I also kinda like getMedia( mediaId, { context: 'view' } )
more 😄 So follow-up PR won't be a problem.
Description
PR fixes the issue when users with the Author role couldn't select images uploaded by other users.
The media entity is only requested for display. Therefore, I think it makes sense to change the request
context
to theview
argument.Fixes #18510.
How has this been tested?
Types of changes
Bugfix
Checklist:
*.native.js
files for terms that need renaming or removal).