untrailingslashit(esc_url_raw($post['api_url'] ?? '')) ?: AIINA_DEFAULT_API_URL, 'firm_name' => sanitize_text_field($post['firm_name'] ?? ''), 'practice_areas' => sanitize_text_field($post['practice_areas'] ?? ''), 'faq_text' => sanitize_textarea_field($post['faq_text'] ?? ''), 'notify_email' => sanitize_email($post['notify_email'] ?? ''), 'accent' => sanitize_hex_color($post['accent'] ?? '') ?: '#1e3a8a', ); update_option('aiina_settings', $opt); // Register this firm's config with the backend. $resp = wp_remote_post($opt['api_url'] . '/register-site', array( 'headers' => array('Content-Type' => 'application/json'), 'timeout' => 15, 'body' => wp_json_encode(array( 'site_id' => $site_id, 'firm_name' => $opt['firm_name'], 'practice_areas' => $opt['practice_areas'], 'faq_text' => $opt['faq_text'], 'notify_email' => $opt['notify_email'], )), )); if (is_wp_error($resp)) { echo '
Saved locally, but could not reach the backend: ' . esc_html($resp->get_error_message()) . '
Settings saved and synced to the assistant.
Configure your assistant. Your Site ID is
(keep this).