| @@ -139,25 +139,29 @@ | ||
| 139 | 139 | 'formStyling' => [ |
| 140 | 140 | 'type' => 'object', |
| 141 | 141 | 'description' => __( 'Form styling settings including colors and spacing.', 'sureforms' ), |
| 142 | 142 | 'properties' => [ |
| 143 | - 'primaryColor' => [ | |
| 143 | + 'primaryColor' => [ | |
| 144 | 144 | 'type' => 'string', |
| 145 | 145 | 'description' => __( 'Primary/accent color as hex (e.g. #111C44).', 'sureforms' ), |
| 146 | 146 | ], |
| 147 | - 'textColor' => [ | |
| 147 | + 'textColor' => [ | |
| 148 | 148 | 'type' => 'string', |
| 149 | 149 | 'description' => __( 'Text color as hex (e.g. #1E1E1E).', 'sureforms' ), |
| 150 | 150 | ], |
| 151 | - 'textColorOnPrimary' => [ | |
| 151 | + 'textColorOnPrimary' => [ | |
| 152 | 152 | 'type' => 'string', |
| 153 | 153 | 'description' => __( 'Text color on primary backgrounds as hex (e.g. #FFFFFF).', 'sureforms' ), |
| 154 | 154 | ], |
| 155 | - 'fieldSpacing' => [ | |
| 155 | + 'fieldSpacing' => [ | |
| 156 | 156 | 'type' => 'string', |
| 157 | 157 | 'description' => __( 'Spacing between fields.', 'sureforms' ), |
| 158 | 158 | 'enum' => [ 'small', 'medium', 'large' ], |
| 159 | 159 | ], |
| 160 | + 'disableDefaultStyles' => [ | |
| 161 | + 'type' => 'boolean', | |
| 162 | + 'description' => __( 'When true, SureForms does not enqueue its default frontend styles for this form, so the active theme styling applies instead.', 'sureforms' ), | |
| 163 | + ], | |
| 160 | 164 | ], |
| 161 | 165 | ], |
| 162 | 166 | 'emailNotification' => [ |
| 163 | 167 | 'type' => 'object', |
| @@ -390,8 +394,12 @@ | ||
| 390 | 394 | ] |
| 391 | 395 | ); |
| 392 | 396 | |
| 393 | 397 | $post_content = Field_Mapping::generate_gutenberg_fields_from_questions( $request ); |
| 398 | + | |
| 399 | + if ( is_wp_error( $post_content ) ) { | |
| 400 | + return $post_content; | |
| 401 | + } | |
| 394 | 402 | |
| 395 | 403 | if ( ! empty( $post_content ) ) { |
| 396 | 404 | wp_update_post( |
| 397 | 405 | [ |