From 931b6b46058c6c36259a1bf58fad01a7508bec8f Mon Sep 17 00:00:00 2001 From: Shaun Andrews Date: Fri, 5 Feb 2021 16:24:03 -0500 Subject: [PATCH] Bringing back the removeNavigationBlockEditUnsupportedFeatures, which hides the ability to toggle submenu indicators. --- packages/edit-navigation/src/index.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/packages/edit-navigation/src/index.js b/packages/edit-navigation/src/index.js index eff5a6c358f6d0..2d8190847e067c 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 ) {