diff --git a/services/AmForms_FieldsService.php b/services/AmForms_FieldsService.php index 4ffef3c..e3d734a 100644 --- a/services/AmForms_FieldsService.php +++ b/services/AmForms_FieldsService.php @@ -54,7 +54,7 @@ public function getProperFieldTypes($fieldTypes) */ public function getSupportedFieldTypes() { - return array( + $supportedFields = array( 'AmForms_Hidden', 'Assets', 'Checkboxes', @@ -66,5 +66,25 @@ public function getSupportedFieldTypes() 'RadioButtons', 'AmForms_Email', ); + + return array_merge($supportedFields, $this->getCustomFieldTypes()); + } + + /** + * Get custom field types. + * + * @return array + */ + public function getCustomFieldTypes() + { + $customFieldTypes = []; + + foreach (craft()->plugins->call('amFormsCustomFields') as $customFieldTypes) { + foreach ($customFieldTypes as $customFieldType) { + $customFieldTypes[] = $customFieldType; + } + } + + return $customFieldTypes; } }