From 4fe27b25d68db4d2b4df001381a861cfa4892182 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Grzegorz=20Zi=C3=B3=C5=82kowski?= Date: Fri, 22 Nov 2024 16:40:02 +0100 Subject: [PATCH] Inserter: Remove reference to Pattern Directory when disabled --- .../inserter/block-patterns-tab/patterns-filter.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/block-editor/src/components/inserter/block-patterns-tab/patterns-filter.js b/packages/block-editor/src/components/inserter/block-patterns-tab/patterns-filter.js index 766082bd7690d9..8193088e0ae063 100644 --- a/packages/block-editor/src/components/inserter/block-patterns-tab/patterns-filter.js +++ b/packages/block-editor/src/components/inserter/block-patterns-tab/patterns-filter.js @@ -101,6 +101,11 @@ export function PatternsFilter( { } } + // Run only when the directory is disabled. + const menuOptions = PATTERN_SOURCE_MENU_OPTIONS.filter( + ( { value } ) => value !== 'directory' + ); + return ( <> { handleSetSourceFilterChange( value ); scrollContainerRef.current?.scrollTo(