| @@ -25,9 +25,9 @@ | ||
| 25 | 25 | $selector = apply_filters( 'frm_create_field_value_selector', $selector, $field_id, $args ); |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | if ( ! is_object( $selector ) ) { |
| 29 | - $selector = new FrmFieldValueSelector( $field_id, $args ); | |
| 29 | + return new FrmFieldValueSelector( $field_id, $args ); | |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | return $selector; |
| 33 | 33 | } |
| @@ -73,9 +73,9 @@ | ||
| 73 | 73 | * @return FrmFieldType |
| 74 | 74 | */ |
| 75 | 75 | public static function get_field_type( $field_type, $field = 0 ) { |
| 76 | 76 | $class = self::get_field_type_class( $field_type ); |
| 77 | - return empty( $class ) ? new FrmFieldDefault( $field, $field_type ) : new $class( $field, $field_type ); | |
| 77 | + return $class ? new $class( $field, $field_type ) : new FrmFieldDefault( $field, $field_type ); | |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | /** |
| 81 | 81 | * @since 3.0 |
| @@ -101,11 +101,15 @@ | ||
| 101 | 101 | 'hidden' => 'FrmFieldHidden', |
| 102 | 102 | 'captcha' => 'FrmFieldCaptcha', |
| 103 | 103 | 'name' => 'FrmFieldName', |
| 104 | 104 | 'credit_card' => 'FrmFieldCreditCard', |
| 105 | + 'address' => 'FrmFieldAddress', | |
| 105 | 106 | // Submit button field. |
| 106 | 107 | FrmSubmitHelper::FIELD_TYPE => 'FrmFieldSubmit', |
| 107 | 108 | FrmFieldGdprHelper::FIELD_TYPE => FrmFieldGdprHelper::get_gdpr_field_class( $field_type ), |
| 109 | + 'product' => 'FrmFieldProduct', | |
| 110 | + 'quantity' => 'FrmFieldQuantity', | |
| 111 | + 'total' => 'FrmFieldTotal', | |
| 108 | 112 | ); |
| 109 | 113 | |
| 110 | 114 | $class = $type_classes[ $field_type ] ?? ''; |
| 111 | 115 | |
| @@ -121,9 +125,9 @@ | ||
| 121 | 125 | */ |
| 122 | 126 | public static function field_has_html( $type ) { |
| 123 | 127 | $has_html = self::field_has_property( $type, 'has_html' ); |
| 124 | 128 | |
| 125 | - // this hook is here for reverse compatibility since 3.0 | |
| 129 | + // This hook is here for reverse compatibility since 3.0 | |
| 126 | 130 | return apply_filters( 'frm_show_custom_html', $has_html, $type ); |
| 127 | 131 | } |
| 128 | 132 | |
| 129 | 133 | /** |