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.
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.
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.
I don't think we should use it here.
This is a temporary placeholder while #19256 is worked on.
youknowriad
left a comment
There was a problem hiding this comment.
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: