Skip to content

Instantly share code, notes, and snippets.

@derhasi
Created January 25, 2011 09:17
Show Gist options
  • Save derhasi/794698 to your computer and use it in GitHub Desktop.
Save derhasi/794698 to your computer and use it in GitHub Desktop.
Theme override for field acces field select widget to add an additional class.
<?php
/**
* Override theme_faf_select().
*/
function mytheme_faf_select($element) {
$children = $element['#children'];
// Adds a faf-field class to the first appearance of the form-item class.
$children = preg_replace('&class="[^"]*(form-item)[^"]*"&is', 'class="\1 faf-select"', $children, 1);
return $children;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment