diff --git a/packages/block-library/src/site-description/block.json b/packages/block-library/src/site-description/block.json index fa41286e8ab679..09310e07f29a39 100644 --- a/packages/block-library/src/site-description/block.json +++ b/packages/block-library/src/site-description/block.json @@ -4,5 +4,34 @@ "supports": { "align": [ "wide", "full" ], "html": false + }, + "attributes": { + "align": { + "type": "string", + "default": "wide" + }, + "textAlign": { + "type": "string", + "default": "center" + }, + "textColor": { + "type": "string" + }, + "customTextColor": { + "type": "string" + }, + "backgroundColor": { + "type": "string" + }, + "customBackgroundColor": { + "type": "string" + }, + "fontSize": { + "type": "string", + "default": "small" + }, + "customFontSize": { + "type": "number" + } } } diff --git a/packages/block-library/src/site-description/edit.js b/packages/block-library/src/site-description/edit.js index c041fb6d452460..75ce88e877e464 100644 --- a/packages/block-library/src/site-description/edit.js +++ b/packages/block-library/src/site-description/edit.js @@ -1,3 +1,8 @@ +/** + * External dependencies + */ +import classNames from 'classnames'; + /** * WordPress dependencies */ @@ -25,6 +30,7 @@ import { ENTER } from '@wordpress/keycodes'; function SiteDescriptionEdit( { attributes, backgroundColor, + className, fontSize, insertDefaultBlock, setAttributes, @@ -98,11 +104,24 @@ function SiteDescriptionEdit( { { __( 'Update' ) } </> ); diff --git a/packages/block-library/src/site-description/index.php b/packages/block-library/src/site-description/index.php index 01d7e1b2e90768..c5f17faa1d5e47 100644 --- a/packages/block-library/src/site-description/index.php +++ b/packages/block-library/src/site-description/index.php @@ -21,38 +21,7 @@ function register_block_core_site_description() { register_block_type( 'core/site-description', array( - 'attributes' => array( - 'className' => array( - 'type' => 'string', - 'default' => '', - ), - 'align' => array( - 'type' => 'string', - ), - 'textAlign' => array( - 'type' => 'string', - 'default' => 'center', - ), - 'textColor' => array( - 'type' => 'string', - ), - 'customTextColor' => array( - 'type' => 'string', - ), - 'backgroundColor' => array( - 'type' => 'string', - ), - 'customBackgroundColor' => array( - 'type' => 'string', - ), - 'fontSize' => array( - 'type' => 'string', - ), - 'customFontSize' => array( - 'type' => 'number', - ), - ), - 'render_callback' => 'render_block_core_site_description', + 'render_callback' => 'render_block_core_site_description', ) ); }