diff --git a/packages/block-library/src/paragraph/block.json b/packages/block-library/src/paragraph/block.json index 497a6b2c29a66..e796f22f492fe 100644 --- a/packages/block-library/src/paragraph/block.json +++ b/packages/block-library/src/paragraph/block.json @@ -1,6 +1,7 @@ { "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, + "temporarilyDisableIframe": "I understand that this flag will only work for two releases (6.2 and 6.3) and that the block must be updated to avoid breakage in WP 6.4.", "name": "core/paragraph", "title": "Paragraph", "category": "text", diff --git a/packages/edit-post/src/components/visual-editor/index.js b/packages/edit-post/src/components/visual-editor/index.js index 21760ccfb40dd..449f4c24c3a3b 100644 --- a/packages/edit-post/src/components/visual-editor/index.js +++ b/packages/edit-post/src/components/visual-editor/index.js @@ -36,7 +36,7 @@ import { useSelect, useDispatch } from '@wordpress/data'; import { useMergeRefs } from '@wordpress/compose'; import { arrowLeft } from '@wordpress/icons'; import { __ } from '@wordpress/i18n'; -import { parse } from '@wordpress/blocks'; +import { parse, store as blocksStore } from '@wordpress/blocks'; import { store as coreStore } from '@wordpress/core-data'; /** @@ -155,6 +155,17 @@ export default function VisualEditor( { styles } ) { ( select ) => select( editPostStore ).hasMetaBoxes(), [] ); + const hasIframeIncompatibleBlocks = useSelect( + ( select ) => + select( blocksStore ) + .getBlockTypes() + .some( + ( { temporarilyDisableIframe } ) => + temporarilyDisableIframe === + 'I understand that this flag will only work for two releases (6.2 and 6.3) and that the block must be updated to avoid breakage in WP 6.4.' + ), + [] + ); const { themeHasDisabledLayoutStyles, themeSupportsLayout, isFocusMode } = useSelect( ( select ) => { const _settings = select( blockEditorStore ).getSettings(); @@ -339,7 +350,9 @@ export default function VisualEditor( { styles } ) { >