[wp-trac] [WordPress Trac] #63839: Layout type classname incorrect for custom blocks

WordPress Trac noreply at wordpress.org
Mon Aug 18 17:27:17 UTC 2025


#63839: Layout type classname incorrect for custom blocks
--------------------------+-----------------------------
 Reporter:  peroks        |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  6.8.2
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 This bug has already been **reported** in the Gutenberg repository here:
 https://github.com/WordPress/gutenberg/issues/53295 and even **fixed** in
 this PR: https://github.com/WordPress/gutenberg/pull/53404

 Unfortunately, the PHP fix was not ported back to WordPress core, so as of
 WP 6.8.2, the bug is still not fixed.

 The bug is found here: https://github.com/WordPress/wordpress-
 develop/blob/6.8.2/src/wp-includes/block-supports/layout.php#L861

 Current/buggy PHP code
 {{{#!php
 <?php
 $block_name    = explode( '/', $block['blockName'] );
 $class_names[] = 'wp-block-' . end( $block_name ) . '-' .
 $layout_classname;
 }}}


 Fixed code in the Gutenberg repository
 {{{#!php
 <?php
 $split_block_name = explode( '/', $block['blockName'] );
 $full_block_name  = 'core' === $split_block_name[0] ? end(
 $split_block_name ) : implode( '-', $split_block_name );
 $class_names[]    = 'wp-block-' . $full_block_name . '-' .
 $layout_classname;
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/63839>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list