diff --git a/blocks/library/cover-image/index.js b/blocks/library/cover-image/index.js index dc125c42d7132..722a74d19762c 100644 --- a/blocks/library/cover-image/index.js +++ b/blocks/library/cover-image/index.js @@ -19,7 +19,7 @@ import InspectorControls from '../../inspector-controls'; import ToggleControl from '../../inspector-controls/toggle-control'; import BlockDescription from '../../block-description'; -const { text } = source; +const { children } = source; const validAlignments = [ 'left', 'center', 'right', 'wide', 'full' ]; @@ -32,8 +32,8 @@ registerBlockType( 'core/cover-image', { attributes: { title: { - type: 'string', - source: text( 'h2' ), + type: 'array', + source: children( 'h2' ), }, url: { type: 'string', diff --git a/blocks/test/fixtures/core__cover-image.json b/blocks/test/fixtures/core__cover-image.json index a782e37abec59..b685a776a62fa 100644 --- a/blocks/test/fixtures/core__cover-image.json +++ b/blocks/test/fixtures/core__cover-image.json @@ -4,7 +4,9 @@ "name": "core/cover-image", "isValid": true, "attributes": { - "title": "Guten Berg!", + "title": [ + "Guten Berg!" + ], "url": "https://cldup.com/uuUqE_dXzy.jpg", "hasParallax": false, "hasBackgroundDim": true