Skip to content

Commit

Permalink
Use Submenu in Page List conversion to blocks.
Browse files Browse the repository at this point in the history
  • Loading branch information
tellthemachines committed Aug 27, 2021
1 parent 7c27324 commit cd044db
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@ export const convertSelectedBlockToNavigationLinks = ( {
pages.forEach( ( { id, title, link: url, type, parent } ) => {
// See if a placeholder exists. This is created if children appear before parents in list
const innerBlocks = linkMap[ id ]?.innerBlocks ?? [];
const blockType = linkMap[ id ]?.innerBlocks
? 'core/navigation-submenu'
: 'core/navigation-link';
linkMap[ id ] = createBlock(
'core/navigation-link',
blockType,
{
id,
label: title.rendered,
Expand Down

0 comments on commit cd044db

Please sign in to comment.