| @@ -32,10 +32,13 @@ | ||
| 32 | 32 | $required = ''; |
| 33 | 33 | if(isset($field->is_required) && $field->is_required == 1) |
| 34 | 34 | $required = '*'; |
| 35 | 35 | |
| 36 | +if(isset($field->rules) && strpos($field->rules, 'required') !== FALSE) | |
| 37 | + $required = '*'; | |
| 38 | + | |
| 36 | 39 | $dbusers = get_users( array( 'search' => '', |
| 37 | - 'order_by' => 'ID', 'order' => 'DESC')); | |
| 40 | + 'orderby' => 'display_name', 'order' => 'ASC')); | |
| 38 | 41 | |
| 39 | 42 | $users = array(); |
| 40 | 43 | foreach($dbusers as $dbuser) { |
| 41 | 44 | $users[wmvc_show_data('ID', $dbuser)] = '#'.wmvc_show_data('ID', $dbuser).', '.wmvc_show_data('display_name', $dbuser); |
| @@ -42,12 +45,31 @@ | ||
| 42 | 45 | } |
| 43 | 46 | |
| 44 | 47 | ?> |
| 45 | 48 | |
| 46 | -<div class="wdk-field-edit <?php echo esc_attr($field->field_type); ?> wdk-col-<?php echo esc_attr($field->columns_number); ?> <?php echo esc_attr($field->class); ?>"> | |
| 49 | +<div class="wdk-field-<?php echo esc_attr($field_id);?> wdk-field-edit <?php echo esc_attr($field->field_type); ?> wdk-col-<?php echo esc_attr($field->columns_number); ?> <?php echo esc_attr($field->class); ?>"> | |
| 47 | 50 | <label for="<?php echo esc_attr($field_id); ?>"><?php echo esc_html($field_label).esc_html($required); ?></label> |
| 48 | 51 | <div class="wdk-field-container"> |
| 49 | - <?php echo wdk_treefield_option($field_id, 'user_m', wmvc_show_data($field_id, $db_data, ''), 'display_name', '', __('Not Selected', 'wpdirectorykit'));?> | |
| 52 | + <?php | |
| 53 | + echo wp_kses( | |
| 54 | + wdk_treefield_option($field_id, 'user_m', wmvc_show_data($field_id, $db_data, ''), 'display_name', '', __('Not Selected', 'wpdirectorykit')), | |
| 55 | + array( | |
| 56 | + 'select' => array( | |
| 57 | + 'class' => true, | |
| 58 | + 'id' => true, | |
| 59 | + 'name' => true, | |
| 60 | + 'multiple' => true, | |
| 61 | + 'style' => true, | |
| 62 | + ), | |
| 63 | + 'option' => array( | |
| 64 | + 'value' => true, | |
| 65 | + 'selected' => true, | |
| 66 | + ), | |
| 67 | + // Add more allowed tags/attributes if wdk_treefield_option outputs others | |
| 68 | + ) | |
| 69 | + ); | |
| 70 | + ?> | |
| 71 | + | |
| 50 | 72 | |
| 51 | 73 | <?php |
| 52 | 74 | // echo wmvc_select_option($field_id, $users, wmvc_show_data($field_id, $db_data, ''), NULL, __('Not Selected', 'wpdirectorykit')); |
| 53 | 75 | ?> |