class-evf-ai-ajax.php
3 weeks ago
class-evf-ai-api.php
3 weeks ago
class-evf-ai-form-builder.php
4 weeks ago
class-evf-ai-loader.php
4 weeks ago
class-evf-ai-registration.php
4 weeks ago
class-evf-ai-loader.php
34 lines
| 1 | <?php |
| 2 | /** |
| 3 | * ThemeGrill AI Cloud — Everest Forms integration loader. |
| 4 | * |
| 5 | * Bootstraps the AI integration after Everest Forms initializes. |
| 6 | * Included once from class-everest-forms.php::includes(). |
| 7 | * |
| 8 | * Gateway: https://github.com/themegrill/themegrill-ai-cloud |
| 9 | * wp-config.php (local dev): |
| 10 | * define( 'TG_AI_GATEWAY_URL', 'http://localhost:8000' ); |
| 11 | */ |
| 12 | |
| 13 | defined( 'ABSPATH' ) || exit; |
| 14 | |
| 15 | add_action( 'everest_forms_loaded', static function () { |
| 16 | $ai_dir = EVF_ABSPATH . 'includes/Integrations/AI/'; |
| 17 | |
| 18 | require_once $ai_dir . 'class-evf-ai-registration.php'; |
| 19 | require_once $ai_dir . 'class-evf-ai-api.php'; |
| 20 | require_once $ai_dir . 'class-evf-ai-form-builder.php'; |
| 21 | require_once $ai_dir . 'class-evf-ai-ajax.php'; |
| 22 | |
| 23 | // Boot AJAX handlers (all requests). These power the "Create with AI" flow in |
| 24 | // the templates UI (src/templates/components/CreateWithAI.tsx). |
| 25 | new EVF_AI_Ajax(); |
| 26 | |
| 27 | // Public REST endpoint the gateway calls back to during domain ownership verification. |
| 28 | // No auth required — security is provided by the one-time transient token. |
| 29 | add_action( 'rest_api_init', array( 'EVF_AI_Registration', 'register_verify_endpoint' ) ); |
| 30 | |
| 31 | // NOTE: The in-builder "Generate Form with AI" modal (EVF_AI_Builder_UI) has |
| 32 | // been removed — its Python gateway calls now live in the Create with AI UI. |
| 33 | } ); |
| 34 |