Skip to content

Commit

Permalink
Fix: Logical error in filterPatterns on sidebar-edit-mode/template-pa…
Browse files Browse the repository at this point in the history
…nel/hooks.js. (#59218)

Co-authored-by: scruffian <[email protected]>
Co-authored-by: jorgefilipecosta <[email protected]>
Co-authored-by: MaggieCabrera <[email protected]>
Co-authored-by: ntsekouras <[email protected]>
Co-authored-by: anton-vlasenko <[email protected]>
  • Loading branch information
6 people authored Feb 20, 2024
1 parent a016d82 commit 5e7152f
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,13 @@ function filterPatterns( patterns, template ) {
pattern.templateTypes?.includes( template.slug ) ||
pattern.blockTypes?.includes( 'core/template-part/' + template.area );

return patterns.filter(
filterOutDuplicatesByName &&
filterOutExcludedPatternSources &&
filterCompatiblePatterns
);
return patterns.filter( ( pattern, index, items ) => {
return (
filterOutDuplicatesByName( pattern, index, items ) &&
filterOutExcludedPatternSources( pattern ) &&
filterCompatiblePatterns( pattern )
);
} );
}

function preparePatterns( patterns, template, currentThemeStylesheet ) {
Expand Down

0 comments on commit 5e7152f

Please sign in to comment.