must_render( $field ) ) { $field_id = 'wpml-tp-extra-field-' . $field->name; $row = ''; $row .= ''; $row .= ''; $row .= ''; $row .= ''; switch ( $field->type ) { case 'select': $row .= ''; break; case 'textarea': $row .= ''; break; case 'radio': case 'checkbox': $row .= '
    '; foreach ( $field->items as $id => $name ) { $row .= '
  1. '; $row .= ' '; $row .= ''; $row .= '
  2. '; } $row .= '
'; break; case 'text': default: $type = null !== $field->type ? $field->type : 'text'; $row .= ''; break; } $row .= ''; $row .= ''; return $row; } return ''; } /** * @param $field * * @return bool */ private function must_render( $field ) { $must_render = isset( $field->type ) && $field->type; if ( $must_render && in_array( $field->type, $this->fields_with_items, true ) ) { $must_render = isset( $field->items ) && $field->items; } return $must_render; } }