PluginProbe
Elementor Website Builder – more than just a page builder / 4.1.0-dev1
Elementor Website Builder – more than just a page builder v4.1.0-dev1
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 4.0.7 All 451 releases
elementor / modules / wp-rest / module.php

module.php in Elementor Website Builder – more than just a page builder 4.1.0-dev1, at modules/wp-rest/module.php

41 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Elementor\Modules\WpRest;
4
5 use Elementor\Core\Base\Module as BaseModule;
6 use Elementor\Modules\WpRest\Classes\Design_System_REST_API;
7 use Elementor\Modules\WpRest\Classes\Elementor_Post_Meta;
8 use Elementor\Modules\WpRest\Classes\Elementor_Settings;
9 use Elementor\Modules\WpRest\Classes\Elementor_User_Meta;
10 use Elementor\Modules\WpRest\Classes\Post_Query;
11 use Elementor\Modules\WpRest\Classes\Term_Query;
12 use Elementor\Modules\WpRest\Classes\User_Query;
13 use Elementor\Plugin;
14
15 if ( ! defined( 'ABSPATH' ) ) {
16 exit; // Exit if accessed directly.
17 }
18
19 class Module extends BaseModule {
20
21 public function get_name() {
22 return 'wp-rest';
23 }
24
25 public function __construct() {
26 parent::__construct();
27
28 add_action( 'rest_api_init', function () {
29 ( new Elementor_Post_Meta() )->register();
30 ( new Elementor_Settings() )->register();
31 ( new Elementor_User_Meta() )->register();
32 ( new Post_Query() )->register( Post_Query::ENDPOINT );
33 ( new Term_Query() )->register( Term_Query::ENDPOINT );
34 ( new User_Query() )->register( User_Query::ENDPOINT );
35 if ( Plugin::instance()->experiments->is_feature_active( 'site-builder' ) ) {
36 ( new Design_System_REST_API() )->register();
37 }
38 } );
39 }
40 }
41