-
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
Comment Template: Add blockGap
support
#69292
base: trunk
Are you sure you want to change the base?
Comment Template: Add blockGap
support
#69292
Conversation
blockGap
support to Comment Template
blockGap
support to Comment Template
blockGap
support to Comment Template
blockGap
support
36f8fbb
to
6d4637c
Compare
|
||
// Set the block name to one that does not correspond to an existing registered block. | ||
// This ensures that for the inner instances of the Comment Template block, we do not render any block supports. | ||
$block_instance['blockName'] = 'core/null'; |
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.
Setting the blockName
of a specific block_instance
to core/null
effectively prevents unintended layout
class names from being applied to inner elements. This approach addresses a known issue and is currently the best way to handle it (as far as I can think).
Reference: PR 41827
@@ -159,7 +159,6 @@ public function test_inner_block_inserted_by_render_block_data_is_retained() { | |||
|
|||
$args = $render_block_callback->get_args(); | |||
$this->assertSame( 'core/comment-content', $args[0][2]->name ); | |||
$this->assertSame( 'core/comment-template', $args[1][2]->name ); |
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.
This change is necessary after making the changes mentioned above.
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @EldarAgalarov. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
What?
Closes #69284
Part of #43243
This PR adds
Block Gap
support to theComment Template
Block.Why?
Post Template
andComment Template
.bottom margin
to add spacing between multiple comments,Block Gap
would streamline and simplify the process.How?
block.json
was updated to incorporate the support forlayout
andblockGap
.tests
were effectively handled as per the code comments mentioned below.Testing Instructions
Comments
Block.Comment Template
was automatically inserted as an inner block.styles
tab of theComment Template
block.Block Spacing
settings are effectively applied on both theeditor
andfront-end
screens.Screencast