Skip to content

Instantly share code, notes, and snippets.

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/b5d7bd28675f6d33d29c to your computer and use it in GitHub Desktop.
Save UserMetaPro/b5d7bd28675f6d33d29c to your computer and use it in GitHub Desktop.
add_filter( 'user_meta_field_config', 'user_meta_field_config_add_asterisk', 10, 3 );
function user_meta_field_config_add_asterisk( $field, $fieldID, $formName ){
if( !empty($field['required']) || in_array($field['field_type'], array('user_login', 'user_email')) ){
if( !empty( $field['field_title'] ) )
$field['field_title'] .= '<span class="um_required">*</span>';
}
return $field;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment