Skip to content

Commit 66f3fa0

Browse files
Editor: Include namespace in layout classname for non-core blocks.
Adds block namespace in layout classname so global styles can be built correctly. Props isabel_brison, wildworks, peroks, rishabhwp. Fixes #63844, #63839. git-svn-id: https://develop.svn.wordpress.org/trunk@60651 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 6d9f8fa commit 66f3fa0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/wp-includes/block-supports/layout.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -858,8 +858,9 @@ function wp_render_layout_support_flag( $block_content, $block ) {
858858
}
859859

860860
// Add combined layout and block classname for global styles to hook onto.
861-
$block_name = explode( '/', $block['blockName'] );
862-
$class_names[] = 'wp-block-' . end( $block_name ) . '-' . $layout_classname;
861+
$split_block_name = explode( '/', $block['blockName'] );
862+
$full_block_name = 'core' === $split_block_name[0] ? end( $split_block_name ) : implode( '-', $split_block_name );
863+
$class_names[] = 'wp-block-' . $full_block_name . '-' . $layout_classname;
863864

864865
// Add classes to the outermost HTML tag if necessary.
865866
if ( ! empty( $outer_class_names ) ) {

0 commit comments

Comments
 (0)