Skip to content

Audio block: Add transcript field for accessibility#78858

Open
Vrishabhsk wants to merge 1 commit into
WordPress:trunkfrom
Vrishabhsk:add/audio-transcript
Open

Audio block: Add transcript field for accessibility#78858
Vrishabhsk wants to merge 1 commit into
WordPress:trunkfrom
Vrishabhsk:add/audio-transcript

Conversation

@Vrishabhsk

Copy link
Copy Markdown
Contributor

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?

  • Added a transcript string attribute to core/audio block.json
  • Rendered as a RichText paragraph inside the <figure> (only when content exists or block is selected)
  • Styled with caption-style() so it's visually consistent with the existing figcaption

Testing Instructions

  1. Open a post or page in the editor
  2. Insert an Audio block and upload an audio file
  3. Click below the audio player
  4. Type or paste a transcript
  5. Save and view the post
  6. Verify the transcript appears as a paragraph below the audio player
  7. With a screen reader (e.g. VoiceOver ⌘F5), navigate to the audio — the transcript is reachable and read in the linear reading order

Use of AI Tools

  • Use of minimax-m3:cloud model provided by Ollama was utilized to research and provide a11y insights.
  • This PR was authored with the help of AI tooling.

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
@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown

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.

  • Required label: Any label starting with [Type].
  • Labels found: .

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.

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown

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.

Unlinked Accounts

The 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.

Unlinked contributors: ekazda.

Co-authored-by: Vrishabhsk <vrishabhsk@git.wordpress.org>
Co-authored-by: im3dabasia <im3dabasia1@git.wordpress.org>
Co-authored-by: joedolson <joedolson@git.wordpress.org>

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Block library /packages/block-library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Audio Block: Transcript Upload Feature

1 participant