Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
You can add css class directly to field
add_filter( 'user_meta_field_config', 'commonCssClassToAllFields', 10, 3 );
function commonCssClassToAllFields( $field, $fieldID, $formName ){
$field['field_class'] = 'my-common-class ';
return $field;
}
@andrei-gheorghiu
Copy link

andrei-gheorghiu commented Jan 24, 2015

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]"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment