PluginProbe
Elementor Website Builder – more than just a page builder / 4.2.0
Elementor Website Builder – more than just a page builder v4.2.0
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.2.0, at modules/web-cli/module.php

50 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 'elementor-vendors-redux',
29 'jquery',
30 ],
31 ELEMENTOR_VERSION,
32 true
33 );
34
35 $this->print_config( 'elementor-web-cli' );
36 }
37
38 protected function get_init_settings() {
39 return [
40 'isDebug' => ( defined( 'WP_DEBUG' ) && WP_DEBUG ),
41 'urls' => [
42 'rest' => get_rest_url(),
43 'assets' => ELEMENTOR_ASSETS_URL,
44 ],
45 'nonce' => wp_create_nonce( 'wp_rest' ),
46 'version' => ELEMENTOR_VERSION,
47 ];
48 }
49 }
50