We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ba6cac8 commit 9faa927Copy full SHA for 9faa927
src/hooks/use-preset-controls.js
@@ -73,7 +73,12 @@ export const usePresetControls = property => {
73
// are not explicitly set to `false` in theme.json v3.
74
if ( hasThemePresets && wpDefaultPresets && defaultSizesEnabled !== false ) {
75
// Create a set for removing duplicates.
76
- const existingSlugs = new Set( _themePresets.map( item => item.slug ) )
+ const existingSlugs = new Set()
77
+ _themePresets.forEach( item => {
78
+ if ( item && typeof item.slug === 'string' ) {
79
+ existingSlugs.add( item.slug )
80
+ }
81
+ } )
82
83
themePresets = [
84
..._themePresets,
0 commit comments