mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-14 05:40:30 +00:00
Editor: fix classname output on blocks without layout.
Prevents layout classnames from being output on blocks with no layout support and no child layout classnames by returning early from `wp_render_layout_support_flag`. Props andrewserong. Fixes #60292. git-svn-id: https://develop.svn.wordpress.org/trunk@57328 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -171,6 +171,7 @@ class Test_Block_Supports_Layout extends WP_UnitTestCase {
|
||||
/**
|
||||
* @ticket 57584
|
||||
* @ticket 58548
|
||||
* @ticket 60292
|
||||
*
|
||||
* @dataProvider data_layout_support_flag_renders_classnames_on_wrapper
|
||||
*
|
||||
@@ -250,6 +251,25 @@ class Test_Block_Supports_Layout extends WP_UnitTestCase {
|
||||
),
|
||||
'expected_output' => '<div class="wp-block-group"><div class="wp-block-group__inner-wrapper is-layout-flow wp-block-group-is-layout-flow"></div></div>',
|
||||
),
|
||||
'skip classname output if block does not support layout and there are no child layout classes to be output' => array(
|
||||
'args' => array(
|
||||
'block_content' => '<p>A paragraph</p>',
|
||||
'block' => array(
|
||||
'blockName' => 'core/paragraph',
|
||||
'attrs' => array(
|
||||
'style' => array(
|
||||
'layout' => array(
|
||||
'selfStretch' => 'fit',
|
||||
),
|
||||
),
|
||||
),
|
||||
'innerBlocks' => array(),
|
||||
'innerHTML' => '<p>A paragraph</p>',
|
||||
'innerContent' => array( '<p>A paragraph</p>' ),
|
||||
),
|
||||
),
|
||||
'expected_output' => '<p>A paragraph</p>',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user