Skip to content

Commit

Permalink
Post Title: improve preview on the editor site (WordPress#50147)
Browse files Browse the repository at this point in the history
* rename post-title to title and update labels

* fix E2E test
  • Loading branch information
gigitux authored and sethrubenstein committed Jul 13, 2023
1 parent d99d32a commit 646925b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/reference-guides/core-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ Show minutes required to finish reading the post. ([Source](https://github.com/W
- **Supports:** color (background, gradients, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~
- **Attributes:** textAlign

## Post Title
## Title

Displays the title of a post, page, or any other content-type. ([Source](https://github.com/WordPress/gutenberg/tree/trunk/packages/block-library/src/post-title))

Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/post-title/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"name": "core/post-title",
"title": "Post Title",
"title": "Title",
"category": "theme",
"description": "Displays the title of a post, page, or any other content-type.",
"textdomain": "default",
Expand Down
4 changes: 1 addition & 3 deletions packages/block-library/src/post-title/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ export default function PostTitleEdit( {
} ),
} );

let titleElement = (
<TagName { ...blockProps }>{ __( 'Post Title' ) }</TagName>
);
let titleElement = <TagName { ...blockProps }>{ __( 'Title' ) }</TagName>;

if ( postType && postId ) {
titleElement = userCanEdit ? (
Expand Down
2 changes: 1 addition & 1 deletion packages/e2e-tests/specs/editor/blocks/post-title.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe( 'Post Title block', () => {

it( 'Can edit the post title', async () => {
// Create a block with some text that will trigger a list creation.
await insertBlock( 'Post Title' );
await insertBlock( 'Title' );
const editablePostTitleSelector =
'.wp-block-post-title[contenteditable="true"]';
await page.waitForSelector( editablePostTitleSelector );
Expand Down

0 comments on commit 646925b

Please sign in to comment.