From cd044db2d197ce2d5e65f42bc4d568daed03a636 Mon Sep 17 00:00:00 2001 From: tellthemachines Date: Wed, 25 Aug 2021 17:57:47 +1000 Subject: [PATCH] Use Submenu in Page List conversion to blocks. --- .../block-library/src/page-list/convert-to-links-modal.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/block-library/src/page-list/convert-to-links-modal.js b/packages/block-library/src/page-list/convert-to-links-modal.js index e900a9ab94d38..557ce6aeb2df9 100644 --- a/packages/block-library/src/page-list/convert-to-links-modal.js +++ b/packages/block-library/src/page-list/convert-to-links-modal.js @@ -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,