WordPress.org

Make WordPress Core

Ticket #27402: 27402.patch

File 27402.patch, 741 bytes (added by joedolson, 7 years ago)

Add aria-describedby support to gallery output

  • wp-includes/media.php

     
    975975                if ( isset( $image_meta['height'], $image_meta['width'] ) )
    976976                        $orientation = ( $image_meta['height'] > $image_meta['width'] ) ? 'portrait' : 'landscape';
    977977
    978                 $output .= "<{$itemtag} class='gallery-item'>";
     978                $output .= "<{$itemtag} class='gallery-item' aria-describedby='$selector-$id'>";
    979979                $output .= "
    980                         <{$icontag} class='gallery-icon {$orientation}'>
     980                        <{$icontag} class='gallery-icon {$orientation}' id='$selector-$id'>
    981981                                $image_output
    982982                        </{$icontag}>";
    983983                if ( $captiontag && trim($attachment->post_excerpt) ) {