Skip to content

Commit

Permalink
Filter out patterns that are not allowed in the inserter (#52675)
Browse files Browse the repository at this point in the history
  • Loading branch information
carolinan authored and tellthemachines committed Jul 24, 2023
1 parent cedb8ca commit b107e07
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ const selectThemePatterns = ( select, { categoryId, search = '' } = {} ) => {
( pattern ) => ! CORE_PATTERN_SOURCES.includes( pattern.source )
)
.filter( filterOutDuplicatesByName )
.filter( ( pattern ) => pattern.inserter !== false )
.map( ( pattern ) => ( {
...pattern,
keywords: pattern.keywords || [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ export default function useThemePatterns() {
( pattern ) =>
! CORE_PATTERN_SOURCES.includes( pattern.source )
)
.filter( filterOutDuplicatesByName ),
.filter( filterOutDuplicatesByName )
.filter( ( pattern ) => pattern.inserter !== false ),
[ blockPatterns, restBlockPatterns ]
);

Expand Down

0 comments on commit b107e07

Please sign in to comment.