Ejemplo n.º 1
0
 /**
  * Get field HTML
  *
  * @param mixed $meta
  * @param array $field
  *
  * @return string
  */
 static function html($meta, $field)
 {
     $field['options'] = self::get_options($field);
     switch ($field['field_type']) {
         case 'select':
             return WCQD_METABOX_Select_Field::html($meta, $field);
         case 'select_advanced':
         default:
             return WCQD_METABOX_Select_Advanced_Field::html($meta, $field);
     }
 }
 /**
  * Get field HTML
  *
  * @param $field
  * @param $meta
  *
  * @return string
  */
 static function html($meta, $field)
 {
     $options = $field['options'];
     $terms = get_terms($options['taxonomy'], $options['args']);
     $field['options'] = self::get_options($terms);
     $field['display_type'] = $options['type'];
     $html = '';
     switch ($options['type']) {
         case 'checkbox_list':
             $html = WCQD_METABOX_Checkbox_List_Field::html($meta, $field);
             break;
         case 'checkbox_tree':
             $elements = self::process_terms($terms);
             $html .= self::walk_checkbox_tree($meta, $field, $elements, $options['parent'], true);
             break;
         case 'select_tree':
             $elements = self::process_terms($terms);
             $html .= self::walk_select_tree($meta, $field, $elements, $options['parent'], true);
             break;
         case 'select_advanced':
             $html = WCQD_METABOX_Select_Advanced_Field::html($meta, $field);
             break;
         case 'select':
         default:
             $html = WCQD_METABOX_Select_Field::html($meta, $field);
     }
     return $html;
 }