Site Tagline: Make editable inside content-only locked parents#77762
Site Tagline: Make editable inside content-only locked parents#77762richtabor wants to merge 1 commit into
Conversation
Replaces `contentRole: true` (which marks the block as a transparent container, forcing its editing mode to `disabled` in content-only sections) with `role: "content"` on the `level` attribute, mirroring how Site Title and Post Title flag themselves as content blocks. The tagline's RichText is now editable when its parent is content-only locked, matching Site Title's behavior. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Flaky tests detected in 8ace5ce. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/25070421937
|
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
There was a problem hiding this comment.
Pull request overview
Adjusts how the core/site-tagline block is classified for content-only editing contexts by moving from supports.contentRole to an attribute-level role: "content" marker, and updates the core blocks reference accordingly.
Changes:
- Update
core/site-taglineblock metadata to addrole: "content"to thelevelattribute and removesupports.contentRole. - Update the Core Blocks Reference docs to remove
contentRolefrom Site Tagline’s listed supports.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/block-library/src/site-tagline/block.json | Replaces supports.contentRole with attributes.level.role: "content" for content classification. |
| docs/reference-guides/core-blocks.md | Updates the Site Tagline entry to no longer list contentRole support. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
t-hamano
left a comment
There was a problem hiding this comment.
Thanks for the PR. However, can you clarify the testing procedure? As far as I tested, no issues occurred on the trunk branch.
- Insert the following HTML via the code editor:
<!-- wp:group {"templateLock":"contentOnly","layout":{"type":"constrained"}} --> <div class="wp-block-group"><!-- wp:site-tagline /--></div> <!-- /wp:group -->
- Select the Site Tagline block and edit the text
Recording.2026-04-30.115449.mp4
This part isn't true, possibly hallucinated. The naming is And in the same way What exactly is the issue here? I'm a bit confused by the PR. |
|
I think if we want to add edit: personally, I would just close the PR as it already works as expected in |
Right. Not every block will have an attribute that can be marked with a content role. The |
|
The code snippet seems hallucinated or outdated too. This is the code presently: gutenberg/packages/block-editor/src/store/reducer.js Lines 2660 to 2664 in dbc1427
|
Yea, maybe I had an outdated version? Confirmed it works in trunk. Thanks! |
What
Replaces
supports.contentRole: trueon the Site Tagline block withrole: "content"on itslevelattribute.Why
contentRole: trueis meant for transparent container blocks (e.g.,core/buttons,core/list) — blocks that hold content children but aren't themselves directly editable. The reducer recognizes that flag and assigns those blocks an editing mode ofdisabledinside content-only locked sections, surfacing their children instead:Site Tagline is a leaf block (its text is the content, edited via the
descriptionentity record), not a container. Flagging it as a content-role container forced it intodisabledmode in content-only sections, so theRichTextcouldn't be focused or typed into.This PR aligns Site Tagline with how Site Title and Post Title declare themselves as content blocks: by giving an attribute
role: "content". That makesisContentBlockreturn true via the attribute path (not the contentRole-container path), so the reducer assignscontentOnlyediting mode and the tagline becomes editable inside content-only locked parents — matching Site Title's behavior.Test plan
🤖 Generated with Claude Code