예제 #1
0
 /**
  * Get the options for a dependent Dynamic field
  *
  * @since 2.0.16
  * @param array $args
  * @param array $field
  */
 private static function get_dependent_dynamic_field_options($args, &$field)
 {
     $linked_field = FrmField::getOne($args['linked_field_id']);
     $field['options'] = array();
     $metas = array();
     FrmProEntryMetaHelper::meta_through_join($args['trigger_field_id'], $linked_field, $args['entry_id'], $args['field_data'], $metas);
     $metas = stripslashes_deep($metas);
     if (FrmProFieldsHelper::include_blank_option($metas, $args['field_data'])) {
         $field['options'][''] = '';
     }
     foreach ($metas as $meta) {
         $field['options'][$meta->item_id] = FrmEntriesHelper::display_value($meta->meta_value, $linked_field, array('type' => $linked_field->type, 'show_icon' => true, 'show_filename' => false));
         unset($meta);
     }
     // change the form_select value so the filter doesn't override the values
     $args['field_data']->field_options['form_select'] = 'filtered_' . $args['field_data']->field_options['form_select'];
     $field = apply_filters('frm_setup_new_fields_vars', $field, $args['field_data']);
     // Sort the options
     $field['options'] = apply_filters('frm_data_sort', $field['options'], array('metas' => $metas, 'field' => $args['linked_field_id']));
 }