| @@ -1,15 +1,11 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -defined( 'ABSPATH' ) || exit; | |
| 3 | +defined('ABSPATH') || exit; | |
| 4 | 4 | |
| 5 | 5 | /** |
| 6 | - * All registered action's handlers should be in app\Hooks\Handlers, | |
| 7 | - * addAction is similar to add_action and addCustomAction is just a | |
| 8 | - * wrapper over add_action which will add a prefix to the hook name | |
| 9 | - * using the plugin slug to make it unique in all wordpress plugins, | |
| 10 | - * ex: $app->addCustomAction('foo', ['FooHandler', 'handleFoo']) is | |
| 11 | - * equivalent to add_action('slug-foo', ['FooHandler', 'handleFoo']). | |
| 6 | + * Handlers live in app/Hooks/Handlers. addCustomAction('foo', ...) is | |
| 7 | + * add_action('slug-foo', ...), prefixed with the plugin slug. | |
| 12 | 8 | */ |
| 13 | 9 | |
| 14 | 10 | /** |
| 15 | 11 | * @var $app FluentBooking\Framework\Foundation\Application |
| @@ -27,17 +23,26 @@ | ||
| 27 | 23 | (new \FluentBooking\App\Hooks\Scheduler\FiveMinuteScheduler())->register(); |
| 28 | 24 | (new \FluentBooking\App\Hooks\Scheduler\DailyScheduler())->register(); |
| 29 | 25 | (new \FluentBooking\App\Services\LandingPage\LandingPageHandler())->boot(); |
| 30 | 26 | |
| 27 | +/* | |
| 28 | + * MCP server for AI agents. Off by default: until enabled in Settings, boot() | |
| 29 | + * only registers the Toolkit discovery filters. See docs/mcp-server-spec.md. | |
| 30 | + */ | |
| 31 | +\FluentBooking\App\Modules\MCP\MCPInit::boot(); | |
| 31 | 32 | |
| 33 | + | |
| 32 | 34 | /* |
| 33 | 35 | * Register all the single action handlers |
| 34 | 36 | */ |
| 35 | 37 | $app->addAction('init', 'BlockEditorHandler@init'); |
| 38 | + | |
| 39 | +$app->addAction('wp_ajax_fluent_booking_export_calendar', 'DataExporter@exportCalendar'); | |
| 36 | 40 | $app->addAction('wp_ajax_fluent_booking_export_hosts', 'DataExporter@exportBookingHosts'); |
| 41 | +$app->addAction('wp_ajax_fluent_booking_import_calendar', 'DataImporter@importCalendar'); | |
| 37 | 42 | |
| 38 | 43 | $app->addAction('fluent_booking/after_calendar_event_landing_page', function () { |
| 39 | - echo \FluentBooking\App\Services\LandingPage\LandingPageHelper::getPoweredByHtml(); | |
| 44 | + echo wp_kses_post(\FluentBooking\App\Services\LandingPage\LandingPageHelper::getPoweredByHtml()); | |
| 40 | 45 | }, 10); |
| 41 | 46 | |
| 42 | 47 | add_action('init', function () { |
| 43 | 48 | if (!isset($_REQUEST['gcal'])) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended |
| @@ -42,6 +47,5 @@ | ||
| 42 | 47 | add_action('init', function () { |
| 43 | 48 | if (!isset($_REQUEST['gcal'])) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended |
| 44 | 49 | return; |
| 45 | 50 | } |
| 46 | - | |
| 47 | 51 | }); |