PluginProbe
Elementor Website Builder – more than just a page builder / 3.20.0-dev2
Elementor Website Builder – more than just a page builder v3.20.0-dev2
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 / dev-tools / module.php

module.php in Elementor Website Builder – more than just a page builder 3.20.0-dev2, at modules/dev-tools/module.php

57 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Elementor\Modules\DevTools;
3
4 use Elementor\Core\Base\App;
5
6 if ( ! defined( 'ABSPATH' ) ) {
7 exit; // Exit if accessed directly.
8 }
9
10 /**
11 * Fix issue with 'Potentially polymorphic call. The code may be inoperable depending on the actual class instance passed as the argument.'.
12 * Its tells to the editor that instance() return right module. instead of base module.
13 * @method Module instance()
14 */
15 class Module extends App {
16 /**
17 * @var Deprecation
18 */
19 public $deprecation;
20
21 public function __construct() {
22 $this->deprecation = new Deprecation( ELEMENTOR_VERSION );
23
24 add_action( 'elementor/editor/before_enqueue_scripts', [ $this, 'register_scripts' ] );
25 add_action( 'admin_enqueue_scripts', [ $this, 'register_scripts' ] );
26 add_action( 'wp_enqueue_scripts', [ $this, 'register_scripts' ] );
27 add_action( 'elementor/frontend/after_register_scripts', [ $this, 'register_scripts' ] );
28 add_action( 'elementor/common/after_register_scripts', [ $this, 'register_scripts' ] );
29 }
30
31 public function get_name() {
32 return 'dev-tools';
33 }
34
35 public function register_scripts() {
36 wp_register_script(
37 'elementor-dev-tools',
38 $this->get_js_assets_url( 'dev-tools' ),
39 [],
40 ELEMENTOR_VERSION,
41 true
42 );
43
44 $this->print_config( 'elementor-dev-tools' );
45 }
46
47 protected function get_init_settings() {
48 return [
49 'isDebug' => ( defined( 'WP_DEBUG' ) && WP_DEBUG ),
50 'urls' => [
51 'assets' => ELEMENTOR_ASSETS_URL,
52 ],
53 'deprecation' => $this->deprecation->get_settings(),
54 ];
55 }
56 }
57