-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Enable Post Featured Image to be set, unset and replaced #27224
Conversation
Size Change: +294 B (0%) Total Size: 1.2 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.
I haven't tested but the code itself looks good 👍
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.
Code looks good and appears to be working fine on my test 👍
I agree that it does look weird to have a group for a single item as mentioned in the other comment by @gziolo but it doesn't interfere with anything so I'm OK with this.
> | ||
{ __( 'Clear' ) } | ||
</ToolbarButton> | ||
<MediaReplaceFlow |
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.
One thing I noticed is that MediaReplaceFlow
uses ToolbarGroup
internally:
<ToolbarGroup className="media-replace-flow"> |
That puts a group in another group. It something that we should look into separately as it might be too restrictive choice as @jasmussen pointed out in the linked issue.
I'm unclear about the "unset" feature on this block. Would a user ever unset the featured image and leave the block blank? Unsetting, to me, feels much more like just removing the block. Otherwise the user would "replace" the image. Also now that I see this in action, the unset icon needs iterating. It doesn't work visually next to the block icon. |
Description
Resolves: #24813
This PR enables
Post Featured Image
block to add a Featured image if not exists, to unset it and replace it. If no Featured image exists it shows a Placeholder to set one.Screenshots
Checklist:
-- Thank you @mapk for creating the icon so fast after asking :)!