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
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
altattribute 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 inwp_get_attachment_image()), then passed this toretimage().This worked but I got the WAVE Alert: Redundant title text due to having both
titleandaltattributes.So I need to
retimage()as wellwp_get_attachment_imageinstead.Originally posted by @bobbingwide in #79