Skip to content

Commit

Permalink
Update name to Site Tagline
Browse files Browse the repository at this point in the history
  • Loading branch information
Copons committed Jul 13, 2020
1 parent a008cdc commit dc82e48
Show file tree
Hide file tree
Showing 15 changed files with 55 additions and 55 deletions.
6 changes: 3 additions & 3 deletions docs/designers-developers/developers/themes/theme-json.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ Each block will declare which style properties it exposes. This has been coined
| Columns | Yes | Yes | Yes | Yes |
| Media & text | Yes | Yes | Yes | Yes |
| Site Title | Yes | Yes | - | Yes |
| Site Description | Yes | Yes | - | Yes |
| Site Tagline | Yes | Yes | - | Yes |

[1] The heading block represents 6 distinct HTML elements: H1-H6. It comes with selectors to target each individual element (ex: core/heading/h1 for H1, etc).

Expand All @@ -183,7 +183,7 @@ Each block will declare which style properties it exposes. This has been coined
| Columns | - | - |
| Media & text | - | - |
| Site Title | Yes | Yes |
| Site Description | Yes | Yes |
| Site Tagline | Yes | Yes |

[1] The heading block represents 6 distinct HTML elements: H1-H6. It comes with selectors to target each individual element (ex: core/heading/h1 for H1, etc).

Expand Down Expand Up @@ -397,7 +397,7 @@ The list of features that are currently supported are:
}
}
},
"core/site-description": {
"core/site-tagline": {
"styles": {
"color": {
"background": <value>,
Expand Down
2 changes: 1 addition & 1 deletion lib/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ function gutenberg_reregister_core_block_types() {
'query.php' => 'core/query',
'query-loop.php' => 'core/query-loop',
'query-pagination.php' => 'core/query-pagination',
'site-description.php' => 'core/site-description',
'site-logo.php' => 'core/site-logo',
'site-tagline.php' => 'core/site-tagline',
'site-title.php' => 'core/site-title',
'template-part.php' => 'core/template-part',
)
Expand Down
4 changes: 2 additions & 2 deletions packages/block-library/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ import * as widgetArea from './widget-area';

// Full Site Editing Blocks
import * as siteLogo from './site-logo';
import * as siteTagline from './site-tagline';
import * as siteTitle from './site-title';
import * as siteDescription from './site-description';
import * as templatePart from './template-part';
import * as query from './query';
import * as queryLoop from './query-loop';
Expand Down Expand Up @@ -200,8 +200,8 @@ export const __experimentalRegisterExperimentalCoreBlocks =
// Register Full Site Editing Blocks.
...( __experimentalEnableFullSiteEditing
? [
siteDescription,
siteLogo,
siteTagline,
siteTitle,
templatePart,
query,
Expand Down
36 changes: 0 additions & 36 deletions packages/block-library/src/site-description/index.php

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "core/site-description",
"name": "core/site-tagline",
"category": "design",
"attributes": {
"align": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import {
} from '@wordpress/block-editor';
import { __ } from '@wordpress/i18n';

export default function SiteDescriptionEdit( { attributes, setAttributes } ) {
export default function SiteTaglineEdit( { attributes, setAttributes } ) {
const { align } = attributes;
const [ description, setDescription ] = useEntityProp(
const [ siteTagline, setSiteTagline ] = useEntityProp(
'root',
'site',
'description'
Expand All @@ -39,10 +39,10 @@ export default function SiteDescriptionEdit( { attributes, setAttributes } ) {
className={ classnames( {
[ `has-text-align-${ align }` ]: align,
} ) }
onChange={ setDescription }
placeholder={ __( 'Site Description' ) }
onChange={ setSiteTagline }
placeholder={ __( 'Site Tagline' ) }
tagName={ Block.p }
value={ description }
value={ siteTagline }
/>
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const { name } = metadata;
export { metadata, name };

export const settings = {
title: __( 'Site Description' ),
title: __( 'Site Tagline' ),
icon,
edit,
};
36 changes: 36 additions & 0 deletions packages/block-library/src/site-tagline/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php
/**
* Server-side rendering of the `core/site-tagline` block.
*
* @package WordPress
*/

/**
* Renders the `core/site-tagline` block on the server.
*
* @param array $attributes The block attributes.
*
* @return string The render.
*/
function render_block_core_site_tagline( $attributes ) {
$align_class_name = empty( $attributes['align'] ) ? '' : ' ' . "has-text-align-{$attributes['align']}";

return sprintf(
'<p class="%1$s">%2$s</p>',
'wp-block-site-tagline' . esc_attr( $align_class_name ),
get_bloginfo( 'description' )
);
}

/**
* Registers the `core/site-tagline` block on the server.
*/
function register_block_core_site_tagline() {
register_block_type_from_metadata(
__DIR__ . '/site-tagline',
array(
'render_callback' => 'render_block_core_site_tagline',
)
);
}
add_action( 'init', 'register_block_core_site_tagline' );
4 changes: 2 additions & 2 deletions packages/e2e-tests/fixtures/block-transforms.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,9 +332,9 @@ export const EXPECTED_TRANSFORMS = {
originalBlock: 'Shortcode',
availableTransforms: [ 'Group' ],
},
'core__site-description': {
'core__site-tagline': {
availableTransforms: [ 'Group' ],
originalBlock: 'Site Description',
originalBlock: 'Site Tagline',
},
'core__site-title': {
availableTransforms: [ 'Group' ],
Expand Down

This file was deleted.

This file was deleted.

1 change: 1 addition & 0 deletions packages/e2e-tests/fixtures/blocks/core__site-tagline.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- wp:site-tagline /-->
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"clientId": "_clientId_0",
"name": "core/site-description",
"name": "core/site-tagline",
"isValid": true,
"attributes": {},
"innerBlocks": [],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[
{
"blockName": "core/site-description",
"blockName": "core/site-tagline",
"attrs": {},
"innerBlocks": [],
"innerHTML": "",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- wp:site-tagline /-->

0 comments on commit dc82e48

Please sign in to comment.