-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Block support: Add server-side processing for ariaLabel #69096
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
|
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. |
|
I followed the testing instructions but I don't see the label on the front. |
|
@carolinan Thanks for the testing. Did you perform the following steps?
|
|
Yes. |
|
We're getting very close to the deadline for this shipping in WordPress 6.8. I've added it to the WordPress 6.8 Editor Tasks project board for visibility. |
|
It works correctly in my environment.
Maybe I was unclear about which line to update. This might be the cause. I have updated the testing instructions.
|
|
I wasn't able to run the test alone, |
Mamaduka
left a comment
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.
Thanks, @t-hamano!
I think this is good to merge. If there's any additional feedback regarding coding standards in core PR, it could be synced back.
@carolinan, I think test:unit:php doesn't work with --filter because it uses npm-run-all script. Try using test:unit:php:base.
|
Thanks for the review! |
) * Block support: Add server-side processing for ariaLabel * Add backport changelog * Add unit test Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: carolinan <poena@git.wordpress.org> Co-authored-by: Mamaduka <mamaduka@git.wordpress.org> Co-authored-by: aaronrobertshaw <aaronrobertshaw@git.wordpress.org> Co-authored-by: joemcgill <joemcgill@git.wordpress.org> Co-authored-by: fabiankaegy <fabiankaegy@git.wordpress.org>

What?
ariaLabelblock support #68764Why?
In #69002, we updated the schema and added a migration to change the attribute value to a comment delimiter so that the
ariaLabelblock support would work in dynamic blocks.However, because server-side processing was missing, this support did not work properly in blocks that used the
ServerSideRendercomponent, 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
Note that the
get_block_wrapper_attributesfunction is in lines 46 and 92. Update line 92.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: