Add red asterisk(*) to all required fields

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;
}

Leave a Reply

Subscribe to our newsletter