Created
August 14, 2014 10:14
-
-
Save UserMetaPro/5356cd5e17492fd9a78f to your computer and use it in GitHub Desktop.
You can add css class directly to field
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
add_filter( 'user_meta_field_config', 'commonCssClassToAllFields', 10, 3 ); | |
function commonCssClassToAllFields( $field, $fieldID, $formName ){ | |
$field['field_class'] = 'my-common-class '; | |
return $field; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You should add the space after user class programatically.
Took me a while to realize why my class would apply on some fields and not on others. The ones requiring validation resulted in
class = "form-controlvalidate[required]"