Skip to content

Commit

Permalink
Use all the settings origins for a block that consumes paths with mer…
Browse files Browse the repository at this point in the history
…ge. (#55219)

Co-authored-by: Jason Crist <146530+pbking@users.noreply.github.com>
  • Loading branch information
matiasbenedetto and pbking authored Oct 10, 2023
1 parent 6a04d57 commit da3d90b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/block-editor/src/components/use-setting/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,12 @@ export default function useSetting( path ) {
// Return if the setting was found in either the block instance or the store.
if ( result !== undefined ) {
if ( PATHS_WITH_MERGE[ normalizedPath ] ) {
return result.custom ?? result.theme ?? result.default;
return [ 'default', 'theme', 'custom' ].reduce(
( acc, key ) => {
return acc.concat( result[ key ] ?? [] );
},
[]
);
}
return result;
}
Expand Down

0 comments on commit da3d90b

Please sign in to comment.