diff --git a/packages/edit-navigation/src/index.js b/packages/edit-navigation/src/index.js index eff5a6c358f6d..2d8190847e067 100644 --- a/packages/edit-navigation/src/index.js +++ b/packages/edit-navigation/src/index.js @@ -11,6 +11,7 @@ import { __experimentalRegisterExperimentalCoreBlocks, } from '@wordpress/block-library'; import { render } from '@wordpress/element'; +import { createHigherOrderComponent } from '@wordpress/compose'; import { __ } from '@wordpress/i18n'; import apiFetch from '@wordpress/api-fetch'; import { addQueryArgs } from '@wordpress/url'; @@ -47,6 +48,24 @@ function removeNavigationBlockSettingsUnsupportedFeatures( settings, name ) { }; } +const removeNavigationBlockEditUnsupportedFeatures = createHigherOrderComponent( + ( BlockEdit ) => ( props ) => { + if ( props.name !== 'core/navigation' ) { + return ; + } + + return ( + + ); + }, + 'removeNavigationBlockEditUnsupportedFeatures' +); + /** * Fetches link suggestions from the API. This function is an exact copy of a function found at: * @@ -137,6 +156,12 @@ export function initialize( id, settings ) { removeNavigationBlockSettingsUnsupportedFeatures ); + addFilter( + 'editor.BlockEdit', + 'core/edit-navigation/remove-navigation-block-edit-unsupported-features', + removeNavigationBlockEditUnsupportedFeatures + ); + registerCoreBlocks(); if ( process.env.GUTENBERG_PHASE === 2 ) {