Skip to content

Conversation

@Utsav-Ladani
Copy link
Contributor

What?

Closes #71831

In the Post Type Label block, allowing the use of Paragraph for formatting with other heading tags and setting it as the default.

Why?

Based on the comment on the issue introducing the "Post Type Label" block:
#71167 (comment)

Most layouts don't need the post type to be a heading. Therefore, adding the Paragraph level option and setting it as the default.

How?

This PR is adding the Paragraph option to the Change Level dropdown and setting default value of level to 0 for the Post Type Label block variation.

Testing Instructions

  1. Open a post or page.
  2. Insert aPost Type Label block.
  3. The default formatting should be Paragraph.
  4. Save the post and check the frontend.
  5. Confirm that post type labels are rendered correctly in both the editor and frontend.

Note

Also ensure that it continues working with the existing Post Type Label block which was inserted with an older version.

Testing Instructions for Keyboard

Screenshots or screencast

Before After
Screenshot 2025-09-29 at 6 22 05 PM Paragraph in level options

@github-actions
Copy link

github-actions bot commented Sep 29, 2025

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: Utsav-Ladani <[email protected]>
Co-authored-by: t-hamano <[email protected]>
Co-authored-by: Drivingralle <[email protected]>

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

@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Sep 29, 2025
@github-actions
Copy link

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @Utsav-Ladani! In case you missed it, we'd love to have you join us in our Slack community.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

My explanation was unclear, but I think the p element should only be supported internally. In the past, there was discussion about whether the p tag should be supported in the UI, even in the Post Title block. As a result, it was limited to internal support due to accessibility concerns. See #30549 for more details.

Since the Post Type Label can also be a title, I think the UI should not be exposed.

@t-hamano t-hamano added [Type] Enhancement A suggestion for improvement. [Block] Query Title Affects the Query Title Block labels Sep 29, 2025
Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@t-hamano t-hamano merged commit ce22a59 into WordPress:trunk Sep 30, 2025
71 checks passed
@github-actions github-actions bot added this to the Gutenberg 21.8 milestone Sep 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Query Title Affects the Query Title Block First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for P-Tag for Post Type Label

2 participants