From 1052456a23a5625bf6566118d4a26df37a8b1c2c Mon Sep 17 00:00:00 2001 From: tomoki shimomura Date: Mon, 31 Jul 2023 16:08:44 +0900 Subject: [PATCH] fix #51723 (#53092) --- packages/block-editor/src/hooks/style.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/block-editor/src/hooks/style.js b/packages/block-editor/src/hooks/style.js index 11946ff53a6de..138867e9c462c 100644 --- a/packages/block-editor/src/hooks/style.js +++ b/packages/block-editor/src/hooks/style.js @@ -11,6 +11,7 @@ import { addFilter } from '@wordpress/hooks'; import { getBlockSupport, hasBlockSupport, + getBlockType, __EXPERIMENTAL_ELEMENTS as ELEMENTS, } from '@wordpress/blocks'; import { createHigherOrderComponent, useInstanceId } from '@wordpress/compose'; @@ -347,6 +348,11 @@ export function addEditProps( settings ) { */ export const withBlockControls = createHigherOrderComponent( ( BlockEdit ) => ( props ) => { + const blockType = getBlockType( props.name ); + if ( ! hasStyleSupport( blockType ) ) { + return ; + } + const shouldDisplayControls = useDisplayBlockControls(); const blockEditingMode = useBlockEditingMode();