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 / web-cli / module.php

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

49 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Elementor\Modules\WebCli;
3
4 use Elementor\Core\Base\App;
5
6 if ( ! defined( 'ABSPATH' ) ) {
7 exit; // Exit if accessed directly.
8 }
9
10 class Module extends App {
11
12 public function get_name() {
13 return 'web-cli';
14 }
15
16 public function __construct() {
17 add_action( 'elementor/editor/before_enqueue_scripts', [ $this, 'register_scripts' ] );
18 add_action( 'admin_enqueue_scripts', [ $this, 'register_scripts' ] );
19 add_action( 'wp_enqueue_scripts', [ $this, 'register_scripts' ] );
20 add_action( 'elementor/frontend/after_register_scripts', [ $this, 'register_scripts' ] );
21 }
22
23 public function register_scripts() {
24 wp_register_script(
25 'elementor-web-cli',
26 $this->get_js_assets_url( 'web-cli' ),
27 [
28 'jquery',
29 ],
30 ELEMENTOR_VERSION,
31 true
32 );
33
34 $this->print_config( 'elementor-web-cli' );
35 }
36
37 protected function get_init_settings() {
38 return [
39 'isDebug' => ( defined( 'WP_DEBUG' ) && WP_DEBUG ),
40 'urls' => [
41 'rest' => get_rest_url(),
42 'assets' => ELEMENTOR_ASSETS_URL,
43 ],
44 'nonce' => wp_create_nonce( 'wp_rest' ),
45 'version' => ELEMENTOR_VERSION,
46 ];
47 }
48 }
49