PluginProbe
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! / trunk
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! vtrunk
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 / image-replace / module.php

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

39 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Image-replace module (spec 023-image-replace-module).
4 *
5 * REST: image search (`GET /templately/v1/ai-content/images`) — relocated from
6 * includes/API/AIContent.php's search_images()/register_routes(), a self-contained
7 * method with no shared state and no custom permission override (fell through to the
8 * base API::_permission_check() default there too). The upload tab additionally uses
9 * the standard WordPress Media Library (`wp/v2/media`) REST endpoint via
10 * `wp_enqueue_media()`, already called globally for all Templately admin screens by
11 * the admin infrastructure (spec 011) — no PHP registration needed for that part.
12 *
13 * The JS (ImageReplacePanel/ + LightBoxForAiConversation.js — relocated verbatim from
14 * react-src/app/components/fsi/sidebar/ImageReplacePanel/ and react-src/app/components/
15 * core/, both had zero consumers outside this feature) has no independent mount point —
16 * it's deep-imported directly by its callers (the not-yet-extracted FSI sidebar's
17 * AiConversationPanel.tsx, the SDK surface in react-src/sdk/, and the root
18 * templately.js bundle for window.TemplatelyImageReplacePanelIsolated), matching spec
19 * 019's "no webpack partial" pattern.
20 *
21 * @package Templately
22 */
23
24 namespace Templately\Modules\ImageReplace;
25
26 use Templately\Core\Module_Base;
27 use Templately\Modules\ImageReplace\REST\ImageSearch;
28
29 class Module extends Module_Base {
30
31 public function get_name(): string {
32 return 'image-replace';
33 }
34
35 public function register_rest_routes(): void {
36 ImageSearch::get_instance()->register_routes();
37 }
38 }
39