Skip to content

Commit

Permalink
Truncate 'core/' from block class name
Browse files Browse the repository at this point in the history
  • Loading branch information
ockham committed Feb 11, 2025
1 parent 5a60033 commit 4baadee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/e2e-tests/plugins/block-hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function gutenberg_test_set_hooked_block_inner_html( $hooked_block, $hooked_bloc
( 'core/block' === $anchor_block['blockName'] && 'first_child' === $relative_position )
) {
$hooked_block['attrs'] = array(
'className' => "hooked-block-${relative_position}-" . $anchor_block['blockName'],
'className' => "hooked-block-${relative_position}-" . str_replace( 'core/', '', $anchor_block['blockName'] ),
);
$hooked_block['innerContent'] = array(
sprintf(
Expand Down
5 changes: 4 additions & 1 deletion test/e2e/specs/editor/plugins/block-hooks.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ test.describe( 'Block Hooks API', () => {
<!-- /wp:paragraph -->`;

const getHookedBlockClassName = ( relativePosition, anchorBlock ) =>
`hooked-block-${ relativePosition }-${ anchorBlock }`;
`hooked-block-${ relativePosition }-${ anchorBlock.replace(
'core/',
''
) }`;

const getHookedBlockMarkup = ( relativePosition, anchorBlock ) => {
const className = getHookedBlockClassName(
Expand Down

0 comments on commit 4baadee

Please sign in to comment.