Skip to content

Instantly share code, notes, and snippets.

@UserMetaPro
Created August 14, 2014 10:14
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 UserMetaPro/5356cd5e17492fd9a78f to your computer and use it in GitHub Desktop.
Save UserMetaPro/5356cd5e17492fd9a78f to your computer and use it in GitHub Desktop.
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

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