Skip to content

v2.0.2 - New Feature: Aria-Hidden Attribute for Cover Blocks

Choose a tag to compare

@Silver0034 Silver0034 released this 13 Feb 16:52
· 5 commits to main since this release

Accessibility Improvement: Aria-Hidden Attribute for Cover Blocks

In this release, we've introduced an enhancement to the rendering of cover blocks. This improvement targets the accessibility of background images that don't have alt tags.

Previously, background images of cover blocks without alt tags were not hidden from screen readers. This could lead to confusion as these images are often decorative and not necessary for understanding the content.

The render_block method in the Aria_Attributes class has been updated to automatically add the aria-hidden="true" attribute to such images. Here's a brief overview of the changes:

  • Added a step to parse the block content and find img elements without alt tags.
  • Added a step to add the aria-hidden="true" attribute to these img elements.
  • Updated the step that returns the modified block content to include these changes.

This enhancement ensures that screen readers correctly ignore decorative images, improving the accessibility of websites using our plugin.