Skip to content

Conversation

@dhruvikpatel18
Copy link
Contributor

What?

Closes #50169

Updates the Comments Title block to dynamically display the post type name in the editor preview instead of showing the hardcoded "Post Title" text.

Why?

Currently, when editing templates for custom post types (like Movies, Products, etc.), the Comments Title block always shows "Post Title" in the preview, which is confusing and doesn't provide accurate context to users. This creates a poor user experience when working with custom post types, as users can't see how the block will actually appear for their specific content type.

Testing Instructions

  1. Create or edit a custom post type template (e.g., Single Movie template)
  2. Add a Comments Title block to the template
  3. Verify that the block preview shows "[Post Type] Title" instead of "Post Title"
  4. Test with different post types to ensure the correct singular name is displayed
  5. Test editing an actual post to ensure the real post title is still shown correctly
  6. Verify that the block still functions properly when post type information is unavailable (should fallback to "Post Title")

Screenshots or screencast

Before

hardcoded.post.title.mov

After

dynamic.post.title.mov

@dhruvikpatel18 dhruvikpatel18 marked this pull request as ready for review June 19, 2025 12:22
@github-actions
Copy link

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: dhruvikpatel18 <dhruvik18@git.wordpress.org>
Co-authored-by: gigitux <gigitux@git.wordpress.org>

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

@shail-mehta shail-mehta added [Type] Enhancement A suggestion for improvement. [Block] Comments Title Affects the Comments Title Block labels Jun 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Comments Title Affects the Comments Title Block [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Comments Title: Displays the post type name as preview in the editor

2 participants