From 169a6e2ce9324f6cdce9918b87977e806b67a49f Mon Sep 17 00:00:00 2001 From: Andrew Duthie Date: Thu, 10 Aug 2017 09:18:51 -0400 Subject: [PATCH 1/2] Cover Image: Extract title as children array --- blocks/library/cover-image/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/blocks/library/cover-image/index.js b/blocks/library/cover-image/index.js index dc125c42d71326..722a74d19762c6 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', From ce77f24c9be93598ca53a409ca962c301750f3cb Mon Sep 17 00:00:00 2001 From: Andrew Duthie Date: Thu, 10 Aug 2017 09:25:52 -0400 Subject: [PATCH 2/2] Cover Image: Regenerate fixtures --- blocks/test/fixtures/core__cover-image.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/blocks/test/fixtures/core__cover-image.json b/blocks/test/fixtures/core__cover-image.json index a782e37abec59a..b685a776a62fa2 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