From 8c2066e1c4a451ac6c3f847b894615ab6e70ca88 Mon Sep 17 00:00:00 2001 From: shimotmk Date: Fri, 28 Jul 2023 14:57:18 +0900 Subject: [PATCH] fix #51723 --- 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();