Skip to content

Instantly share code, notes, and snippets.

@stenrdj
Forked from peteboere/theme_image.php
Created April 13, 2018 13:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stenrdj/d7c8885d8db4c856ad2a98d2e42a8f9e to your computer and use it in GitHub Desktop.
Save stenrdj/d7c8885d8db4c856ad2a98d2e42a8f9e to your computer and use it in GitHub Desktop.
Drupal theme overrides for better accessibility
<?php
/*
theme_image() override.
*/
function THEME_image($vars)
{
// [Accessibility] Images must always have an alt attribute.
if (! isset($vars['alt'])) {
$vars['alt'] = '';
}
return theme_image($vars);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment