Example #1
0
 /**
  * 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);
     $html = '';
     switch ($options['type']) {
         case 'checkbox_list':
             $html = RWMB_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 = RWMB_Select_Advanced_Field::html($meta, $field);
             break;
         case 'select':
         default:
             $html = RWMB_Select_Field::html($meta, $field);
     }
     return $html;
 }