diff --git a/packages/block-editor/src/components/block-settings-menu/block-settings-dropdown.js b/packages/block-editor/src/components/block-settings-menu/block-settings-dropdown.js index b912bb44af5522..29b322129e43a9 100644 --- a/packages/block-editor/src/components/block-settings-menu/block-settings-dropdown.js +++ b/packages/block-editor/src/components/block-settings-menu/block-settings-dropdown.js @@ -29,7 +29,6 @@ import BlockHTMLConvertButton from './block-html-convert-button'; import __unstableBlockSettingsMenuFirstItem from './block-settings-menu-first-item'; import BlockSettingsMenuControls from '../block-settings-menu-controls'; import { store as blockEditorStore } from '../../store'; -import useBlockDisplayTitle from '../block-title/use-block-display-title'; import { useShowMoversGestures } from '../block-toolbar/utils'; const noop = () => {}; @@ -138,11 +137,6 @@ export function BlockSettingsDropdown( { [ __experimentalSelectBlock ] ); - const blockTitle = useBlockDisplayTitle( { - clientId: firstBlockClientId, - maximumLength: 25, - } ); - const updateSelectionAfterRemove = useCallback( __experimentalSelectBlock ? () => { @@ -173,12 +167,8 @@ export function BlockSettingsDropdown( { ] ); - const label = sprintf( - /* translators: %s: block name */ - __( 'Remove %s' ), - blockTitle - ); - const removeBlockLabel = count === 1 ? label : __( 'Remove blocks' ); + const removeBlockLabel = + count === 1 ? __( 'Delete' ) : __( 'Delete blocks' ); // Allows highlighting the parent block outline when focusing or hovering // the parent block selector within the child. diff --git a/packages/e2e-tests/specs/editor/plugins/cpt-locking.test.js b/packages/e2e-tests/specs/editor/plugins/cpt-locking.test.js index 33532f7c43f8bb..1a4d8e2b6d4332 100644 --- a/packages/e2e-tests/specs/editor/plugins/cpt-locking.test.js +++ b/packages/e2e-tests/specs/editor/plugins/cpt-locking.test.js @@ -41,9 +41,7 @@ describe( 'cpt locking', () => { ); await clickBlockToolbarButton( 'Options' ); expect( - await page.$x( - '//button/span[contains(text(), "Remove Paragraph")]' - ) + await page.$x( '//button/span[contains(text(), "Delete")]' ) ).toHaveLength( 0 ); }; @@ -180,7 +178,7 @@ describe( 'cpt locking', () => { 'p1' ); await clickBlockToolbarButton( 'Options' ); - await clickMenuItem( 'Remove Paragraph' ); + await clickMenuItem( 'Delete' ); expect( await getEditedPostContent() ).toMatchSnapshot(); } ); @@ -200,7 +198,7 @@ describe( 'cpt locking', () => { 'p1' ); await clickBlockToolbarButton( 'Options' ); - await clickMenuItem( 'Remove Paragraph' ); + await clickMenuItem( 'Delete' ); expect( await getEditedPostContent() ).toMatchSnapshot(); } ); diff --git a/packages/e2e-tests/specs/editor/various/reusable-blocks.test.js b/packages/e2e-tests/specs/editor/various/reusable-blocks.test.js index c1b985a34ea8f7..a94cb1f7214267 100644 --- a/packages/e2e-tests/specs/editor/various/reusable-blocks.test.js +++ b/packages/e2e-tests/specs/editor/various/reusable-blocks.test.js @@ -244,7 +244,7 @@ describe( 'Reusable blocks', () => { // Delete the block, leaving the reusable block empty. await clickBlockToolbarButton( 'Options' ); const deleteButton = await page.waitForXPath( - '//button/span[text()="Remove Paragraph"]' + '//button/span[text()="Delete"]' ); deleteButton.click(); diff --git a/test/e2e/specs/editor/various/block-deletion.spec.js b/test/e2e/specs/editor/various/block-deletion.spec.js index 6e8329222d4183..d02a9167c0c3af 100644 --- a/test/e2e/specs/editor/various/block-deletion.spec.js +++ b/test/e2e/specs/editor/various/block-deletion.spec.js @@ -41,9 +41,7 @@ test.describe( 'Block deletion', () => { .getByRole( 'toolbar', { name: 'Block tools' } ) .getByRole( 'button', { name: 'Options' } ) .click(); - await page - .getByRole( 'menuitem', { name: 'Remove Paragraph' } ) - .click(); + await page.getByRole( 'menuitem', { name: 'Delete' } ).click(); // Ensure the last block was removed. await expect.poll( editor.getBlocks ).toMatchObject( [ @@ -90,9 +88,7 @@ test.describe( 'Block deletion', () => { .getByRole( 'toolbar', { name: 'Block tools' } ) .getByRole( 'button', { name: 'Options' } ) .click(); - await page - .getByRole( 'menuitem', { name: 'Remove Paragraph' } ) - .click(); + await page.getByRole( 'menuitem', { name: 'Delete' } ).click(); // Ensure the paragraph was removed. await expect @@ -321,9 +317,7 @@ test.describe( 'Block deletion', () => { .getByRole( 'toolbar', { name: 'Block tools' } ) .getByRole( 'button', { name: 'Options' } ) .click(); - await page - .getByRole( 'menuitem', { name: 'Remove Paragraph' } ) - .click(); + await page.getByRole( 'menuitem', { name: 'Delete' } ).click(); // Ensure an empty block was created and focused. await expect( diff --git a/test/e2e/specs/editor/various/block-locking.spec.js b/test/e2e/specs/editor/various/block-locking.spec.js index 7398cc6be7b185..2e977690a1708d 100644 --- a/test/e2e/specs/editor/various/block-locking.spec.js +++ b/test/e2e/specs/editor/various/block-locking.spec.js @@ -19,7 +19,7 @@ test.describe( 'Block Locking', () => { await page.click( 'role=button[name="Apply"]' ); await expect( - page.locator( 'role=menuitem[name="Remove Paragraph"]' ) + page.locator( 'role=menuitem[name="Delete"]' ) ).not.toBeVisible(); } ); diff --git a/test/e2e/specs/editor/various/list-view.spec.js b/test/e2e/specs/editor/various/list-view.spec.js index aaf5a996b85e7b..e7437bc2acbf5d 100644 --- a/test/e2e/specs/editor/various/list-view.spec.js +++ b/test/e2e/specs/editor/various/list-view.spec.js @@ -144,9 +144,7 @@ test.describe( 'List View', () => { await listView .getByRole( 'button', { name: 'Options for Paragraph block' } ) .click(); - await page - .getByRole( 'menuitem', { name: /Remove Paragraph/i } ) - .click(); + await page.getByRole( 'menuitem', { name: /Delete/i } ).click(); // Heading block should be selected as previous block. await expect( @@ -196,7 +194,7 @@ test.describe( 'List View', () => { await listView .getByRole( 'button', { name: 'Options for Image block' } ) .click(); - await page.getByRole( 'menuitem', { name: /Remove Image/i } ).click(); + await page.getByRole( 'menuitem', { name: /Delete/i } ).click(); // Heading block should be selected as previous block. await expect( @@ -247,7 +245,7 @@ test.describe( 'List View', () => { await listView .getByRole( 'button', { name: 'Options for Image block' } ) .click(); - await page.getByRole( 'menuitem', { name: /Remove blocks/i } ).click(); + await page.getByRole( 'menuitem', { name: /Delete blocks/i } ).click(); // Newly created paragraph block should be selected. await expect( diff --git a/test/e2e/specs/widgets/customizing-widgets.spec.js b/test/e2e/specs/widgets/customizing-widgets.spec.js index 9bf3dcb32b371b..110ce28948f228 100644 --- a/test/e2e/specs/widgets/customizing-widgets.spec.js +++ b/test/e2e/specs/widgets/customizing-widgets.spec.js @@ -393,7 +393,7 @@ test.describe( 'Widgets Customizer', () => { // Testing removing the block. await editor.clickBlockToolbarButton( 'Options' ); - await page.click( 'role=menuitem[name=/Remove Legacy Widget/]' ); + await page.click( 'role=menuitem[name=/Delete/]' ); // Add it back again using the variant. const testWidgetBlock = await widgetsCustomizerPage.addBlock(