PluginProbe
Elementor Website Builder – more than just a page builder / 3.32.4
Elementor Website Builder – more than just a page builder v3.32.4
4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 All 452 releases
elementor / app / modules / import-export-customization / data / routes / base-route.php

base-route.php in Elementor Website Builder – more than just a page builder 3.32.4, at app/modules/import-export-customization/data/routes/base-route.php

31 lines 846 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Elementor\App\Modules\ImportExportCustomization\Data\Routes;
4
5 abstract class Base_Route {
6 public function __construct() {}
7
8 public function register_route( $namespace, $base_route ): void {
9 register_rest_route( $namespace, '/' . $base_route . '/' . $this->get_route(), [
10 [
11 'methods' => $this->get_method(),
12 'callback' => fn( $request ) => $this->callback( $request ),
13 'permission_callback' => $this->permission_callback(),
14 'args' => $this->get_args(),
15 ],
16 ] );
17 }
18
19 abstract protected function get_route(): string;
20
21 abstract protected function get_method(): string;
22
23 abstract protected function callback( $request ): \WP_REST_Response;
24
25 protected function permission_callback(): callable {
26 return fn() => current_user_can( 'manage_options' );
27 }
28
29 abstract protected function get_args(): array;
30 }
31