Skip to content

Conversation

@t-hamano
Copy link
Contributor

@t-hamano t-hamano commented Oct 27, 2025

What? Why?

The contentRole support, newly added in version 6.9, has been added to many core blocks. This block support is working very well and can essentially be considered a stable API. Let's document this API.

How?

Welcome your feedback on how we can provide a better explanation!

Testing Instructions

Nothing.

@t-hamano t-hamano self-assigned this Oct 27, 2025
@t-hamano t-hamano added [Type] Developer Documentation Documentation for developers Backport to WP 6.9 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta [Feature] Write mode labels Oct 27, 2025
@t-hamano t-hamano marked this pull request as ready for review October 27, 2025 04:40
@github-actions
Copy link

github-actions bot commented Oct 27, 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: t-hamano <[email protected]>
Co-authored-by: fabiankaegy <[email protected]>

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

Copy link
Member

@fabiankaegy fabiankaegy left a comment

Choose a reason for hiding this comment

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

I think this is a good addition. However I wonder if we can be a little more specific as to where this actually gets used. Because setting a group to templateLock: contentOnly for example doesn't trigger this mode which is what I would have expected.

Would love to get more clarity on this from these docs :)

@t-hamano
Copy link
Contributor Author

@fabiankaegy Thanks for the feedback!

Because setting a group to templateLock: contentOnly for example doesn't trigger this mode which is what I would have expected.

Could you provide more details on this point? It works as expected in my tests.

The HTML I used for testing is as follows:

<!-- wp:group {"templateLock":"contentOnly","layout":{"type":"constrained"}} -->
<div class="wp-block-group">
	<!-- wp:accordion -->
	<div role="group" class="wp-block-accordion">
		<!-- wp:accordion-item -->
		<div class="wp-block-accordion-item">
			<!-- wp:accordion-heading -->
			<h3 class="wp-block-accordion-heading"><button class="wp-block-accordion-heading__toggle"><span class="wp-block-accordion-heading__toggle-title">Accordion Title</span><span class="wp-block-accordion-heading__toggle-icon" aria-hidden="true">+</span></button></h3>
			<!-- /wp:accordion-heading -->

			<!-- wp:accordion-panel {"isSelected":true} -->
			<div role="region" class="wp-block-accordion-panel">
				<!-- wp:paragraph -->
				<p>Accordion Content</p>
				<!-- /wp:paragraph -->
			</div>
			<!-- /wp:accordion-panel -->
		</div>
		<!-- /wp:accordion-item -->
	</div>
	<!-- /wp:accordion -->
</div>
<!-- /wp:group -->
image

@fabiankaegy
Copy link
Member

Ahh yeah I meant that it doesn't allow new items like lost items to be added:

#52018 (comment)

Which in theory is also tied to this block support

@t-hamano
Copy link
Contributor Author

Ahh yeah I meant that it doesn't allow new items like lost items to be added:

I see. Until this problem is resolved, it might be best not to add any more schemas or documents 🤔

@fabiankaegy
Copy link
Member

Yeah I feel like that would be better... Or adding a notice that this is only for WordPress 7.0? Not sure.

@t-hamano
Copy link
Contributor Author

Ahh yeah I meant that it doesn't allow new items like lost items to be added:

I see. Until this problem is resolved, it might be best not to add any more schemas or documents 🤔

Based on this, let's close this pull request for now. We can reconsider updating the documentation and schema in version 7.0.

@t-hamano t-hamano closed this Oct 31, 2025
@t-hamano t-hamano removed the Backport to WP 6.9 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Oct 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants