Block Library: Add a Post Comments Form block.#19954
Conversation
| @@ -0,0 +1,3 @@ | |||
| export default function PostCommentsFormEdit() { | |||
| return 'Post Comments Form Placeholder'; | |||
There was a problem hiding this comment.
Do we want to show a fake form with the possibility to tweak some of comment_form arguments? At least for a start we could use ServerSideRender
There was a problem hiding this comment.
Yeah, we can do that in a follow-up.
There was a problem hiding this comment.
Why a follow-up, it should be very straightforward to add ServerSideRender without any customization.
There was a problem hiding this comment.
It won't render anything in the editor. We need the server-side context work to land to support things like this.
There was a problem hiding this comment.
mmm Right. It seems the "ServerSideRender" component could use some tweaks to pass the parent context.
| if ( ! $post ) { | ||
| return ''; | ||
| } | ||
| return comment_form( array(), $post->ID ); |
There was a problem hiding this comment.
Thinking we should be consistent in all of our blocks about supporting the custom className prop and having a block wrapper with the default className.
There was a problem hiding this comment.
As part of the common block wrapper that @ellatrix worked on?
There was a problem hiding this comment.
That could help making it consistent yes, but for now, we need to add it manually in "edit" functions (the className prop is available there though) and in the server, everything is manual
adc2d21 to
ef21bfa
Compare
| @@ -0,0 +1,3 @@ | |||
| export default function PostCommentsFormEdit() { | |||
| return 'Post Comments Form Placeholder'; | |||
There was a problem hiding this comment.
This text cannot be translated if it's defined statically.
Description
This PR adds a new Post Comments Form 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 Comments Form block for template building.
Checklist: