Accessibility

The Accessibility feature can be enabled or disabled via the Features page in the Greyd Plugin. When activated, it adds an additional setting to the general plugin options that controls how image alt text is handled across the site.

Screenshot of the accessibility setting, explained in the paragraphs before and after.

By default, when no alt text is explicitly set, WordPress may attempt to generate a description from other available fields, such as the image title, caption, or filename. This can lead to generic labels like “screenshot-1234.png” being used, which are unhelpful for users relying on screen readers. While this fallback behavior can improve automated audit scores, it does not meet accessibility standards for descriptive alternative content.

To prevent this behavior, the Accessibility feature in Greyd introduces a filter called greyd_output_generate_attachment_image_alt. When enabled, this filter ensures that only manually entered alt text will be used. If no alt text exists, the image will remain without one, which is a clearer signal to accessibility tools and better aligned with compliance expectations.

This logic is applied internally in functions like get_attachment_text(), where multiple text types can be queried. If the type is set to alt, only the defined alt attribute is returned. Without the feature enabled, fallback logic would try caption and title instead, which may not be meaningful or appropriate.

The feature is applied globally across various components in the Greyd Suite that render images dynamically. This includes standard image blocks, dynamic image blocks, and blocks like Hotspot, where images are injected via dynamic content.

By enforcing proper alt text usage, this feature contributes to better accessibility practices without compromising editorial control. It is shipped as a modular feature within the Features page and can be toggled based on project needs.

Last updated: