-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Block support: Add server-side processing for ariaLabel #69096
base: trunk
Are you sure you want to change the base?
Conversation
Flaky tests detected in f97978a. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/13199665831
|
@@ -0,0 +1,85 @@ | |||
<?php |
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.
This unit test is identical to the test in the core backport PR:
https://github.com/WordPress/wordpress-develop/pull/8274/files#diff-0f32f800b7e03fe08c378308dfb322156ea606714e2f39d095971d02add72a93
On the other hand, the following unit test cannot be included in this PR because it will not pass unless the aria-label
attribute is allowed by default in the get_block_wrapper_attributes
function:
https://github.com/WordPress/wordpress-develop/pull/8274/files#diff-699d565e390f7fb85d4d1c7ade8706b63fe2cec31043e8e18117961ca3f7083d
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. |
Appreciate the ping for review @t-hamano 👍 Unfortunately, my bandwidth is still limited for the time being, such that I won't be able to assist with reviews or testing here. I believe @tellthemachines is also in the same boat, so I've removed us both from the list of reviewers. It might be worth pinging a few more people to get enough eyes on this PR. |
Thank you for your reply. Just to be sure, I would like to ping @WordPress/gutenberg-core, not specific people. |
What?
ariaLabel
block support #68764Why?
In #69002, we updated the schema and added a migration to change the attribute value to a comment delimiter so that the
ariaLabel
block support would work in dynamic blocks.However, because server-side processing was missing, this support did not work properly in blocks that used the
ServerSideRender
component, for example.How?
Like many other block supports, add block support via the register method.
Testing Instructions
Here we will test adding ariaLabel support to the archive block.
First, make the following changes:
Diff
In the post content, insert the following HTML:
<!-- wp:archives {"ariaLabel":"Archive Block Aria Label"} /-->
Confirm that the aria-label attribute is added to the block in both the frontend and the editor.
In the trunk branch, you’ll get an error like this: