New field type: Number

This commit is contained in:
Ultimate Member
2015-12-30 22:08:23 +02:00
parent 395a366ff6
commit 75e5b85d80
6 changed files with 85 additions and 2 deletions
+34
View File
@@ -623,6 +623,12 @@ class UM_Fields {
break;
case 'number':
$array['disabled'] = '';
break;
case 'url':
$array['input'] = 'text';
@@ -990,6 +996,34 @@ class UM_Fields {
$output .= '</div>';
break;
/* Number */
case 'number':
$output .= '<div class="um-field' . $classes . '"' . $conditional . ' data-key="'.$key.'">';
if ( isset( $data['label'] ) ) {
$output .= $this->field_label($label, $key, $data);
}
$output .= '<div class="um-field-area">';
if ( isset($icon) && $icon && isset( $this->field_icons ) && $this->field_icons == 'field' ) {
$output .= '<div class="um-field-icon"><i class="'.$icon.'"></i></div>';
}
$output .= '<input '.$disabled.' class="'.$this->get_class($key, $data).'" type="number" name="'.$key.$ultimatemember->form->form_suffix.'" id="'.$key.$ultimatemember->form->form_suffix.'" value="'. htmlspecialchars( $this->field_value( $key, $default, $data ) ) .'" placeholder="'.$placeholder.'" data-validate="'.$validate.'" data-key="'.$key.'" min="' . $min . '" max="' . $max . '" />
</div>';
if ( $this->is_error($key) ) {
$output .= $this->field_error( $this->show_error($key) );
}
$output .= '</div>';
break;
/* Password */
case 'password':