mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-11 18:56:10 +09:00
- reviewed #1190;
This commit is contained in:
@@ -1613,7 +1613,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
|
||||
$other_order = $value['order'];
|
||||
}
|
||||
} else {
|
||||
if ( ! in_array( $value, array_keys( $field_data['options'] ) ) ) {
|
||||
if ( ! array_key_exists( $value, $field_data['options'] ) ) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -1623,7 +1623,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
|
||||
$options = '';
|
||||
foreach ( $field_data['options'] as $key => $option ) {
|
||||
if ( is_array( $value ) ) {
|
||||
$selected = selected( $key == 'other', true, false );
|
||||
$selected = selected( 'other' === $key, true, false );
|
||||
} else {
|
||||
$selected = selected( $key == $value, true, false );
|
||||
}
|
||||
@@ -1635,21 +1635,19 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
|
||||
if ( $sorting ) {
|
||||
$html .= '<span class="um-field-icon"><i class="um-faicon-sort"></i></span>';
|
||||
}
|
||||
|
||||
$data_types_html = '';
|
||||
foreach ( UM()->member_directory()->sort_data_types as $type_key => $type_label ) {
|
||||
$data_types_html .= '<option value="' . esc_attr( $type_key ) . '" ' . selected( $other_type, $type_key, false ) . '>' . esc_html( $type_label ) . '</option>';
|
||||
}
|
||||
|
||||
$html .= '<span class="um-field-wrapper">
|
||||
<select ' . $id_attr . ' ' . $name_attr . ' ' . $class_attr . ' ' . $data_attr . '>' . $options . '</select></span>
|
||||
<span class="um-field-control"><a href="javascript:void(0);" class="um-select-delete">' . __( 'Remove', 'ultimate-member' ) . '</a></span>
|
||||
<span class="um-field-wrapper um-custom-order-fields"><label>' . __( 'Meta key', 'ultimate-member' ) . ': <input type="text" name="um_metadata[_um_sorting_fields][other_data][' . $k . '][meta_key]" value="' . esc_attr( $other_key ) . '" /></label></span>
|
||||
<span class="um-field-wrapper um-custom-order-fields"><label>' . __( 'Data type', 'ultimate-member' ) . ': <select name="um_metadata[_um_sorting_fields][other_data][' . $k . '][data_type]" />
|
||||
<option value="CHAR" ' . selected( $other_type, 'CHAR', false ) . '>' . __( 'CHAR', 'ultimate-member' ) . '</option>
|
||||
<option value="NUMERIC" ' . selected( $other_type, 'NUMERIC', false ) . '>' . __( 'NUMERIC', 'ultimate-member' ) . '</option>
|
||||
<option value="BINARY" ' . selected( $other_type, 'BINARY', false ) . '>' . __( 'BINARY', 'ultimate-member' ) . '</option>
|
||||
<option value="DATE" ' . selected( $other_type, 'DATE', false ) . '>' . __( 'DATE', 'ultimate-member' ) . '</option>
|
||||
<option value="DATETIME" ' . selected( $other_type, 'DATETIME', false ) . '>' . __( 'DATETIME', 'ultimate-member' ) . '</option>
|
||||
<option value="DECIMAL" ' . selected( $other_type, 'DECIMAL', false ) . '>' . __( 'DECIMAL', 'ultimate-member' ) . '</option>
|
||||
<option value="SIGNED" ' . selected( $other_type, 'SIGNED', false ) . '>' . __( 'SIGNED', 'ultimate-member' ) . '</option>
|
||||
<option value="TIME" ' . selected( $other_type, 'TIME', false ) . '>' . __( 'TIME', 'ultimate-member' ) . '</option>
|
||||
<option value="UNSIGNED" ' . selected( $other_type, 'UNSIGNED', false ) . '>' . __( 'UNSIGNED', 'ultimate-member' ) . '</option>
|
||||
</select></label></span>
|
||||
<span class="um-field-wrapper um-custom-order-fields"><label>' . __( 'Data type', 'ultimate-member' ) . ': <select name="um_metadata[_um_sorting_fields][other_data][' . $k . '][data_type]" />' .
|
||||
$data_types_html .
|
||||
'</select></label></span>
|
||||
<span class="um-field-wrapper um-custom-order-fields"><label>' . __( 'Order', 'ultimate-member' ) . ': <select name="um_metadata[_um_sorting_fields][other_data][' . $k . '][order]" />
|
||||
<option value="ASC" ' . selected( $other_order, 'ASC', false ) . '>' . __( 'ASC', 'ultimate-member' ) . '</option>
|
||||
<option value="DESC" ' . selected( $other_order, 'DESC', false ) . '>' . __( 'DESC', 'ultimate-member' ) . '</option>
|
||||
|
||||
Reference in New Issue
Block a user