Created
January 25, 2011 09:17
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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