Skip to content

Post Title: Add placeholder attribute#76016

Merged
Mamaduka merged 1 commit into
WordPress:trunkfrom
xristos3490:fix/issue-75938
Mar 2, 2026
Merged

Post Title: Add placeholder attribute#76016
Mamaduka merged 1 commit into
WordPress:trunkfrom
xristos3490:fix/issue-75938

Conversation

@xristos3490

@xristos3490 xristos3490 commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

What?

Adds a placeholder attribute to the Post Title block so users can customize the placeholder text shown when in template-preview mode.

Closes #75938.

How?

  • Added a placeholder string attribute to block.json
  • Updated the edit component to use the custom placeholder instead of the hardcoded "Title" string; it still falls back to "Title" when the placeholder is empty
  • Updated core-blocks.md docs to reflect the new attribute

Screenshot

placeholder-attr

Testing Instructions

  1. Open the Site Editor
  2. Insert a Post Title block
  3. In the block's attributes (via Code Editor or block JSON), set e.g., "placeholder": "Book title"
  4. Switch back to the visual editor
  5. Expect the Post Title block to display "Book title" instead of the default "Title" when no post is loaded

@github-actions

github-actions Bot commented Feb 27, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: xristos3490 <xristos3490@git.wordpress.org>
Co-authored-by: up1512001 <up1512001@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org>
Co-authored-by: mcsf <mcsf@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@up1512001 up1512001 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM as per #75938 (comment) #75938 (comment)

@Mamaduka Mamaduka added the props-bot Manually triggers Props Bot to ensure the list of props is up to date. label Mar 2, 2026
@github-actions github-actions Bot removed the props-bot Manually triggers Props Bot to ensure the list of props is up to date. label Mar 2, 2026

@Mamaduka Mamaduka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @xristos3490!

@Mamaduka Mamaduka merged commit b4c3a8d into WordPress:trunk Mar 2, 2026
53 of 56 checks passed
@github-actions github-actions Bot added this to the Gutenberg 22.7 milestone Mar 2, 2026
gziolo pushed a commit that referenced this pull request Mar 3, 2026
Co-authored-by: xristos3490 <xristos3490@git.wordpress.org>
Co-authored-by: up1512001 <up1512001@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org>
Co-authored-by: mcsf <mcsf@git.wordpress.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Post Title Affects the Post Title Block [Package] Block library /packages/block-library [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Post Title block: Allow post types to customize title placeholder text

3 participants