diff --git a/packages/edit-site/src/hooks/commands/use-edit-mode-commands.js b/packages/edit-site/src/hooks/commands/use-edit-mode-commands.js index b079c5e956121..0a066a5b6bc06 100644 --- a/packages/edit-site/src/hooks/commands/use-edit-mode-commands.js +++ b/packages/edit-site/src/hooks/commands/use-edit-mode-commands.js @@ -36,7 +36,12 @@ import { PREFERENCES_MODAL_NAME } from '../../components/preferences-modal'; import { PATTERN_MODALS } from '../../components/pattern-modal'; import { TEMPLATE_PART_MODALS } from '../../components/template-part-modal'; import { unlock } from '../../lock-unlock'; -import { TEMPLATE_POST_TYPE, TEMPLATE_ORIGINS } from '../../utils/constants'; +import { + PATTERN_TYPES, + TEMPLATE_ORIGINS, + TEMPLATE_PART_POST_TYPE, + TEMPLATE_POST_TYPE, +} from '../../utils/constants'; const { useHistory } = unlock( routerPrivateApis ); @@ -372,7 +377,7 @@ function usePatternCommands() { const commands = []; - if ( record?.type === 'wp_block' ) { + if ( record?.type === PATTERN_TYPES.user ) { commands.push( { name: 'core/rename-pattern', label: __( 'Rename pattern' ), @@ -393,7 +398,7 @@ function usePatternCommands() { } ); } - if ( record?.type === 'wp_template_part' ) { + if ( record?.type === TEMPLATE_PART_POST_TYPE ) { if ( record?.source === TEMPLATE_ORIGINS.custom ) { commands.push( { name: 'core/rename-template-part',