Skip to content

Commit

Permalink
Fix: Duplicate template part refers to original name instead of dupli…
Browse files Browse the repository at this point in the history
…cated name. (#67329)

Co-authored-by: jorgefilipecosta <[email protected]>
  • Loading branch information
jorgefilipecosta and jorgefilipecosta authored Nov 27, 2024
1 parent 9904fd3 commit 738d5bf
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import type { Action } from '@wordpress/dataviews';
import { TEMPLATE_PART_POST_TYPE } from '../../store/constants';
import { CreateTemplatePartModalContents } from '../../components/create-template-part-modal';
import { getItemTitle } from './utils';
import type { TemplatePart } from '../types';
import type { Post, TemplatePart } from '../types';

const duplicateTemplatePart: Action< TemplatePart > = {
id: 'duplicate-template-part',
Expand All @@ -38,12 +38,12 @@ const duplicateTemplatePart: Action< TemplatePart > = {
);
}, [ item.content, item.blocks ] );
const { createSuccessNotice } = useDispatch( noticesStore );
function onTemplatePartSuccess() {
function onTemplatePartSuccess( templatePart: Post ) {
createSuccessNotice(
sprintf(
// translators: %s: The new template part's title e.g. 'Call to action (copy)'.
_x( '"%s" duplicated.', 'template part' ),
getItemTitle( item )
getItemTitle( templatePart )
),
{ type: 'snackbar', id: 'edit-site-patterns-success' }
);
Expand Down

0 comments on commit 738d5bf

Please sign in to comment.