Skip to content

Add documentation for contentRole and listView block supports#75903

Merged
t-hamano merged 1 commit intotrunkfrom
listview-contentrole-schema
Feb 26, 2026
Merged

Add documentation for contentRole and listView block supports#75903
t-hamano merged 1 commit intotrunkfrom
listview-contentrole-schema

Conversation

@t-hamano
Copy link
Contributor

@t-hamano t-hamano commented Feb 25, 2026

What?

Since contentRole and listView block supports are public APIs, this PR updates the documentation and block.json schema.

The contentRole was actually already available in WP 6.9 but was temporarily undocumented due to a small bug, which should now be fixed. #72695

Testing Instructions

Suggestions for better descriptions are welcome!

@t-hamano t-hamano self-assigned this Feb 25, 2026
@t-hamano t-hamano added the [Type] Developer Documentation Documentation for developers label Feb 25, 2026
@t-hamano t-hamano marked this pull request as ready for review February 25, 2026 12:37
@github-actions
Copy link

github-actions bot commented Feb 25, 2026

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 <wildworks@git.wordpress.org>
Co-authored-by: youknowriad <youknowriad@git.wordpress.org>
Co-authored-by: ramonjd <ramonopoly@git.wordpress.org>
Co-authored-by: tellthemachines <isabel_brison@git.wordpress.org>

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

- Type: `boolean`
- Default value: `false`

Marks the block itself as content. It is intended primarily for blocks that do not declare `content` attributes, or whose content is expressed only through their inner blocks. When enabled, content-only editing modes can still edit these blocks and allow inner blocks to be added or removed.
Copy link
Member

Choose a reason for hiding this comment

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

LGTM, but double checking with @tellthemachines who has been looking at this role for other blocks in #75812

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah LGTM! #75812 doesn't change the behaviour of contentRole, it only changes the ability to insert blocks in containers with content attributes.

@t-hamano t-hamano merged commit 12d0c37 into trunk Feb 26, 2026
57 of 59 checks passed
@t-hamano t-hamano deleted the listview-contentrole-schema branch February 26, 2026 13:53
@github-actions github-actions bot added this to the Gutenberg 22.7 milestone Feb 26, 2026
@t-hamano
Copy link
Contributor Author

I would like to backport this PR to the wp/7.0 branch because both contentRole and listView are available in 7.0 and some developers may be referencing specific versions.

{
	"$schema": "https://schemas.wp.org/wp/7.0/block.json"
}

@t-hamano t-hamano added the Backport to WP 7.0 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Feb 26, 2026
gutenbergplugin pushed a commit that referenced this pull request Feb 26, 2026
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: youknowriad <youknowriad@git.wordpress.org>
Co-authored-by: ramonjd <ramonopoly@git.wordpress.org>
Co-authored-by: tellthemachines <isabel_brison@git.wordpress.org>
@t-hamano
Copy link
Contributor Author

For some reason, the GitHub Action is failing, but the cherry-pick to the 7.0 branch itself was successful.

@t-hamano t-hamano added Backported to WP Core Pull request that has been successfully merged into WP Core and removed Backport to WP 7.0 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta labels Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backported to WP Core Pull request that has been successfully merged into WP Core [Type] Developer Documentation Documentation for developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants