Skip to content

Commit

Permalink
Editor: Remove the 'content-only' check from 'TemplatePartConverterMe…
Browse files Browse the repository at this point in the history
…nuItem'
  • Loading branch information
Mamaduka committed Dec 13, 2024
1 parent 7050a44 commit fb308e9
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions packages/editor/src/components/template-part-menu-items/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,16 @@ export default function TemplatePartMenuItems() {
}

function TemplatePartConverterMenuItem( { clientIds, onClose } ) {
const { isContentOnly, blocks } = useSelect(
const { blocks } = useSelect(
( select ) => {
const { getBlocksByClientId, getBlockEditingMode } =
select( blockEditorStore );
const { getBlocksByClientId } = select( blockEditorStore );
return {
blocks: getBlocksByClientId( clientIds ),
isContentOnly:
clientIds.length === 1 &&
getBlockEditingMode( clientIds[ 0 ] ) === 'contentOnly',
};
},
[ clientIds ]
);

// Do not show the convert button if the block is in content-only mode.
if ( isContentOnly ) {
return null;
}

// Allow converting a single template part to standard blocks.
if ( blocks.length === 1 && blocks[ 0 ]?.name === 'core/template-part' ) {
return (
Expand Down

0 comments on commit fb308e9

Please sign in to comment.