| @@ -397,11 +397,14 @@ | ||
| 397 | 397 | if (array_key_exists('phone', $data)) { |
| 398 | 398 | $prepared['phone'] = sanitize_text_field((string) $data['phone']); |
| 399 | 399 | } |
| 400 | 400 | |
| 401 | - if (array_key_exists('subject', $data)) { | |
| 402 | - $prepared['subject'] = sanitize_text_field((string) $data['subject']); | |
| 403 | - } | |
| 401 | + // NOTE: no `subject` mapping. The enquiries table has never had a | |
| 402 | + // `subject` column, so writing one made $wpdb reject the whole INSERT / | |
| 403 | + // UPDATE — and create() turns that into an exception, which the public | |
| 404 | + // POST /enquiries endpoint surfaced as a 500 carrying the raw SQL error. | |
| 405 | + // Any caller that sends `subject` is now simply ignored, as it always | |
| 406 | + // effectively was for reads. | |
| 404 | 407 | |
| 405 | 408 | if (array_key_exists('message', $data)) { |
| 406 | 409 | $prepared['message'] = sanitize_textarea_field((string) $data['message']); |
| 407 | 410 | } |