Skip to content

feat: add accessible iframe title to embed blocks#79

Merged
YvetteNikolov merged 2 commits into
mainfrom
a11y/video-title
Jun 30, 2026
Merged

feat: add accessible iframe title to embed blocks#79
YvetteNikolov merged 2 commits into
mainfrom
a11y/video-title

Conversation

@YvetteNikolov

Copy link
Copy Markdown
Contributor

A11y: voegt een "YouTube video: ..." of "Vimeo video: ..." titel aan de iframe voor toegankelijkheid. Nodig n.a.v. TeamSportservice

Screenshot 2026-06-30 at 11 32 44 Screenshot 2026-06-30 at 11 32 25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an accessibility improvement to Gutenberg embed blocks by ensuring rendered <iframe> elements receive a descriptive title, improving screen reader output for embedded media (e.g., YouTube/Vimeo).

Changes:

  • Adds a render_block_core/embed filter to set or prefix iframe title attributes based on the embed provider and type.
  • Introduces a provider-slug → human label mapping helper for common embed providers.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Gutenberg.php
Comment on lines +139 to +142
$type = $block['attrs']['type'] ?? '';
if (is_string($type) && in_array($type, ['video', 'audio'], true)) {
$label = sprintf('%s %s', $label, $type);
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Niet nodig, is zowel engels als nederlands

Comment thread src/Gutenberg.php
Comment on lines +124 to +127
/**
* Adds a descriptive title to embed iframes for accessibility - "YouTube video: ..."
* Embeds that render no iframe (Twitter, Instagram, ...) are skipped.
*/

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💩

Comment thread src/Gutenberg.php Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

@WybeBosch WybeBosch left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hehe

@YvetteNikolov YvetteNikolov merged commit 9ec7941 into main Jun 30, 2026
2 checks passed
@YvetteNikolov YvetteNikolov deleted the a11y/video-title branch June 30, 2026 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants