diff --git a/includes/admin/assets/css/um-admin-forms.css b/includes/admin/assets/css/um-admin-forms.css index 36692707..6beb8ecf 100644 --- a/includes/admin/assets/css/um-admin-forms.css +++ b/includes/admin/assets/css/um-admin-forms.css @@ -146,6 +146,14 @@ textarea.um-forms-field.um-small-field { flex: 0.9; } +.um-multi-selects-option-line .um-field-wrapper.um-custom-order-fields label select{ + width: auto; + display: inline; + font-weight: normal; + max-width: 70%; + flex: 0.9; +} + .um-multi-selects-option-line.um-admin-drag-fld .um-field-wrapper { width: calc( 100% - 90px ); } diff --git a/includes/admin/assets/js/um-admin-forms.js b/includes/admin/assets/js/um-admin-forms.js index f47f8017..74d47bcc 100644 --- a/includes/admin/assets/js/um-admin-forms.js +++ b/includes/admin/assets/js/um-admin-forms.js @@ -250,7 +250,7 @@ jQuery(document).ready( function() { '' + wp.i18n.__( 'Remove', 'ultimate-member' ) + '' + '' + '' + - '' + '' + '' + '' + @@ -260,11 +260,11 @@ jQuery(document).ready( function() { '' + '' + '' + - '' + - '' + + '' + + '' + '' + ''; list.append( html ); @@ -274,6 +274,8 @@ jQuery(document).ready( function() { jQuery( '#' + list.data('id_attr') + '-' + k ).parents('li').find('.um-field-wrapper.um-custom-order-fields input[name="meta_key"]').attr('name', 'um_metadata[_um_sorting_fields][other_data][' + k + '][meta_key]'); jQuery( '#' + list.data('id_attr') + '-' + k ).parents('li').find('.um-field-wrapper.um-custom-order-fields input[name="label"]').attr('name', 'um_metadata[_um_sorting_fields][other_data][' + k + '][label]'); + jQuery( '#' + list.data('id_attr') + '-' + k ).parents('li').find('.um-field-wrapper.um-custom-order-fields select[name="data_type"]').attr('name', 'um_metadata[_um_sorting_fields][other_data][' + k + '][data_type]'); + jQuery( '#' + list.data('id_attr') + '-' + k ).parents('li').find('.um-field-wrapper.um-custom-order-fields select[name="order"]').attr('name', 'um_metadata[_um_sorting_fields][other_data][' + k + '][order]'); }); diff --git a/includes/admin/core/class-admin-forms.php b/includes/admin/core/class-admin-forms.php index c5e30524..68995432 100644 --- a/includes/admin/core/class-admin-forms.php +++ b/includes/admin/core/class-admin-forms.php @@ -1594,14 +1594,24 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) { $other_label = ''; $other_type = ''; $other_order = ''; + if ( is_array( $value ) ) { $keys = array_keys( $value ); $other_key = $keys[0]; - $labels = array_values( $value ); - $other_label = $labels[0]; - $other_type = $value['type']; - $other_order = $value['order']; + if ( ! empty( $value['label'] ) ) { + $other_label = $value['label']; + } else { + $labels = array_values( $value ); + $other_label = $labels[0]; + } + + if ( ! empty( $value['type'] ) ) { + $other_type = $value['type']; + } + if ( ! empty( $value['order'] ) ) { + $other_order = $value['order']; + } } else { if ( ! in_array( $value, array_keys( $field_data['options'] ) ) ) { continue; @@ -1629,21 +1639,21 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) { ' . __( 'Remove', 'ultimate-member' ) . ' - - + + '; }