Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Post Title: improve preview on the editor site #50147

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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