Skip to content

Commit

Permalink
Remove "blocks" from copy and delete labels (WordPress#57769)
Browse files Browse the repository at this point in the history
  • Loading branch information
richtabor authored Jan 12, 2024
1 parent 203ca9e commit 22617ed
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ const POPOVER_PROPS = {

function CopyMenuItem( { blocks, onCopy, label } ) {
const ref = useCopyToClipboard( () => serialize( blocks ), onCopy );
const copyMenuItemBlocksLabel =
blocks.length > 1 ? __( 'Copy blocks' ) : __( 'Copy' );
const copyMenuItemLabel = label ? label : copyMenuItemBlocksLabel;
const copyMenuItemLabel = label ? label : __( 'Copy' );
return <MenuItem ref={ ref }>{ copyMenuItemLabel }</MenuItem>;
}

Expand Down Expand Up @@ -202,9 +200,6 @@ export function BlockSettingsDropdown( {
getSelectedBlockClientIds,
] );

const removeBlockLabel =
count === 1 ? __( 'Delete' ) : __( 'Delete blocks' );

// This can occur when the selected block (the parent)
// displays child blocks within a List View.
const parentBlockIsSelected =
Expand Down Expand Up @@ -411,7 +406,7 @@ export function BlockSettingsDropdown( {
) }
shortcut={ shortcuts.remove }
>
{ removeBlockLabel }
{ __( 'Delete' ) }
</MenuItem>
</MenuGroup>
) }
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/specs/editor/various/list-view.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ test.describe( 'List View', () => {
.click();
await page
.getByRole( 'menu', { name: 'Options for Heading' } )
.getByRole( 'menuitem', { name: 'Delete blocks' } )
.getByRole( 'menuitem', { name: 'Delete' } )
.click();
await expect
.poll(
Expand Down

0 comments on commit 22617ed

Please sign in to comment.