PluginProbe
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! / 3.8.0
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! v3.8.0
3.8.0 3.7.5 3.7.4 3.7.3 3.7.2 1-final 3.7.1 3.7.0 3.6.8 3.6.7 3.6.6 3.6.5 3.6.4 3.6.3 3.6.2 3.6.1 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 All 112 releases
templately / modules / library-tour / module.php

module.php in Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! 3.8.0, at modules/library-tour/module.php

49 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Library tour module (spec 036-library-tour).
4 *
5 * Relocated: includes/API/Tour.php (the REST controller — 3 endpoints:
6 * GET tour/status, POST tour/complete, POST tour/reset) +
7 * react-src/app/components/new-components/tour/ (9-file React component
8 * tree: LibraryTour, DetailTour, TourTooltip, TourContext, TourMenuItem,
9 * TourShortcutListener, useTourShortcut, tourSteps, index barrel).
10 * Namespace: Templately\API\Tour -> Templately\Modules\LibraryTour\REST\Tour.
11 *
12 * No boot-ordering fix needed: Tour::get_instance() was eagerly instantiated
13 * in Plugin::apis() (during plugins_loaded) purely to self-register into the
14 * platform-adapter Platform_Registry::add($this, 'API') registry — a registration that
15 * Plugin::register_routes() already skips for any Templately\Modules\* class
16 * (see that method's own skip-comment). The eager call was simply removed;
17 * this module's register_rest_routes() wires the real route registration on
18 * rest_api_init via Module_Base::boot_rest_routes(), the same lazy pattern
19 * every module-owned REST class uses (013-035) — no autoloader-timing hazard
20 * for a class only ever resolved at rest_api_init.
21 *
22 * JS ships inside the main bundle (LibraryTour/DetailTour/TourMenuItem/
23 * TourProvider/TourShortcutListener are all statically imported from
24 * App.js, NewItemDetails.js, UserNavigation.js, and
25 * modules/template-browsing's TemplatesTypeLayout.js — not a lazy module
26 * route), matching the established precedent from specs 034/035 for
27 * main-bundle features: no webpack.config.partial.js, no attachReducer/
28 * runSaga (this feature has no Redux state at all — TourContext is a plain
29 * React context).
30 *
31 * @package Templately
32 */
33
34 namespace Templately\Modules\LibraryTour;
35
36 use Templately\Core\Module_Base;
37 use Templately\Modules\LibraryTour\REST\Tour;
38
39 class Module extends Module_Base {
40
41 public function get_name(): string {
42 return 'library-tour';
43 }
44
45 public function register_rest_routes(): void {
46 Tour::get_instance()->register_routes();
47 }
48 }
49