From 97cb5b53dc314651ef36dfe73c42cbb8cd37633e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9?= <583546+oandregal@users.noreply.github.com> Date: Fri, 18 Oct 2024 17:52:26 +0200 Subject: [PATCH] Convert parent to array in block registration --- packages/blocks/src/api/registration.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/blocks/src/api/registration.js b/packages/blocks/src/api/registration.js index ef1b6bd20a4cdd..429a7235cded48 100644 --- a/packages/blocks/src/api/registration.js +++ b/packages/blocks/src/api/registration.js @@ -232,6 +232,13 @@ export function registerBlockType( blockNameOrMetadata, settings ) { return; } + if ( + typeof settings?.parent === 'string' || + settings?.parent instanceof String + ) { + settings.parent = [ settings.parent ]; + } + if ( 1 === settings?.parent?.length && name === settings.parent[ 0 ] ) { warning( 'Block "' +