Audio block: Add transcript field for accessibility#78858
Conversation
Adds a 'transcript' attribute to the Audio block that allows users to provide a text alternative for the audio content, satisfying WCAG 1.2.1 (Audio-only and Video-only Prerecorded). - Adds a new 'transcript' string attribute in block.json - Adds a RichText control in the editor for adding a transcript - Renders the transcript in the saved output below the caption - Adds caption-style styling to the transcript paragraph - Updates generated core-blocks.md to document the new attribute
|
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
|
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 Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @ekazda. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. 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. |
What?
Why?
WCAG 1.2.1 (Level A) requires a text alternative for prerecorded audio-only content. The Audio block had no way to provide one.
How?
transcriptstring attribute tocore/audioblock.jsonRichTextparagraph inside the<figure>(only when content exists or block is selected)caption-style()so it's visually consistent with the existing figcaptionTesting Instructions
Use of AI Tools