Skip to content

Improve accessibility ( a11y ) of oik and oik-fields #41

Description

@bobbingwide

It's probably also necessary to remove the title= attribute from <img> tags.

Well, it's been a long time since I looked at accessibility of oik's code.
Having run WAVE against oik-plugins.com I thought it was time to add an alt attribute to the Featured image field displayed by the [bw_field] shortcode.

I changed bw_fields_get_featured_image() to access the alt text for the featured image (using the same code as in wp_get_attachment_image() ), then passed this to retimage().

$alt = trim( strip_tags( get_post_meta( $thumbnail_id, '_wp_attachment_image_alt', true ) ) );
$thumbnail = retimage( "featured", $thumbnail[0], $alt );

This worked but I got the WAVE Alert: Redundant title text due to having both title and alt attributes.

So I need to

  • change retimage() as well
  • or call wp_get_attachment_image instead.

Originally posted by @bobbingwide in #79

Metadata

Metadata

Assignees

Labels

a11yAccessibility ( a11y ) improvements.enhancement

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions