PluginProbe
Elementor Website Builder – more than just a page builder / 4.2.4
Elementor Website Builder – more than just a page builder v4.2.4
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 4.2.4, at modules/dev-tools/module.php

58 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 *
14 * @method Module instance()
15 */
16 class Module extends App {
17 /**
18 * @var Deprecation
19 */
20 public $deprecation;
21
22 public function __construct() {
23 $this->deprecation = new Deprecation( ELEMENTOR_VERSION );
24
25 add_action( 'elementor/editor/before_enqueue_scripts', [ $this, 'register_scripts' ] );
26 add_action( 'admin_enqueue_scripts', [ $this, 'register_scripts' ] );
27 add_action( 'wp_enqueue_scripts', [ $this, 'register_scripts' ] );
28 add_action( 'elementor/frontend/after_register_scripts', [ $this, 'register_scripts' ] );
29 add_action( 'elementor/common/after_register_scripts', [ $this, 'register_scripts' ] );
30 }
31
32 public function get_name() {
33 return 'dev-tools';
34 }
35
36 public function register_scripts() {
37 wp_register_script(
38 'elementor-dev-tools',
39 $this->get_js_assets_url( 'dev-tools' ),
40 [],
41 ELEMENTOR_VERSION,
42 true
43 );
44
45 $this->print_config( 'elementor-dev-tools' );
46 }
47
48 protected function get_init_settings() {
49 return [
50 'isDebug' => ( defined( 'WP_DEBUG' ) && WP_DEBUG ),
51 'urls' => [
52 'assets' => ELEMENTOR_ASSETS_URL,
53 ],
54 'deprecation' => $this->deprecation->get_settings(),
55 ];
56 }
57 }
58