-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Add documentation and schema for contentRole block support #72695
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
88fa486 to
69ebd0f
Compare
|
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.
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 :)
|
@fabiankaegy Thanks for the feedback!
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 -->
|
|
Ahh yeah I meant that it doesn't allow new items like lost items to be added: Which in theory is also tied to this block support |
I see. Until this problem is resolved, it might be best not to add any more schemas or documents 🤔 |
|
Yeah I feel like that would be better... Or adding a notice that this is only for WordPress 7.0? Not sure. |
Based on this, let's close this pull request for now. We can reconsider updating the documentation and schema in version 7.0. |

What? Why?
The
contentRolesupport, 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.