-
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
Block Library: Add a Post Excerpt block. #19579
Conversation
|
||
function PostExcerptDisplay() { | ||
const [ excerpt ] = useEntityProp( 'postType', 'post', 'excerpt' ); | ||
return <RichText.Content tagName="p" value={ excerpt } />; |
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.
In the sidebar of the editor, we use a TextareaControl to edit the excerpt, it makes me think we should use PlainText here. any reason for not making this editable?
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 was trying to be minimal with these changes by making the new blocks read-only first so that we can land them faster and then iterate.
I've changed it to use PlainText
now since I agree it is more fitting, and the complexity doesn't increase much.
|
||
export default function PostExcerptEdit() { | ||
if ( ! useEntityId( 'postType', 'post' ) ) { | ||
return 'Post Excerpt Placeholder'; |
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.
i18n
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 don't think we should use it here.
This is a temporary placeholder while #19256 is worked on.
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 noticed a focused style for the PlainText component, I don't think this was intended and was probably introduced by mistake but it's separate from that PR.
Description
This PR adds a new Post Excerpt block akin to the Post Title and Post Content blocks.
How has this been tested?
Types of Changes
New Feature: There is a new Post Excerpt block for template building.
Checklist: