PluginProbe
Elementor Website Builder – more than just a page builder / 3.20.0-dev3
Elementor Website Builder – more than just a page builder v3.20.0-dev3
4.3.0-beta3 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 All 452 releases
← All changes | modules/notifications/module.php +32 -21 3.20.0-dev23.20.0-dev3 View file →
@@ -40,31 +40,42 @@
40 40 $this->get_app_js_config()
41 41 );
42 42 }, 5 /* Before Elementor's admin enqueue scripts */ );
43 43
44 - add_action( 'elementor/editor/after_enqueue_scripts', function() {
45 - wp_enqueue_script(
46 - 'e-editor-notifications',
47 - $this->get_js_assets_url( 'editor-notifications' ),
48 - [
49 - 'elementor-editor',
50 - 'elementor-v2-ui',
51 - 'elementor-v2-icons',
52 - 'elementor-v2-query',
53 - 'wp-i18n',
54 - ],
55 - ELEMENTOR_VERSION,
56 - true
57 - );
44 + add_action( 'elementor/editor/v2/scripts/enqueue', [ $this, 'enqueue_editor_scripts' ] );
45 + add_action( 'elementor/editor/after_enqueue_scripts', [ $this, 'enqueue_editor_scripts' ] );
58 46
59 - wp_localize_script(
60 - 'e-editor-notifications',
61 - 'elementorNotifications',
62 - $this->get_app_js_config()
63 - );
64 - } );
47 + add_action( 'elementor/ajax/register_actions', [ $this, 'register_ajax_actions' ] );
48 + }
65 49
66 - add_action( 'elementor/ajax/register_actions', [ $this, 'register_ajax_actions' ] );
50 + public function enqueue_editor_scripts() {
51 + $deps = [
52 + 'elementor-editor',
53 + 'elementor-v2-ui',
54 + 'elementor-v2-icons',
55 + 'elementor-v2-query',
56 + 'wp-i18n',
57 + ];
58 +
59 + $is_editor_v2 = current_action() === 'elementor/editor/v2/scripts/enqueue';
60 +
61 + if ( $is_editor_v2 ) {
62 + $deps[] = 'elementor-v2-editor-app-bar';
63 + }
64 +
65 + wp_enqueue_script(
66 + 'e-editor-notifications',
67 + $this->get_js_assets_url( 'editor-notifications' ),
68 + $deps,
69 + ELEMENTOR_VERSION,
70 + true
71 + );
72 +
73 + wp_localize_script(
74 + 'e-editor-notifications',
75 + 'elementorNotifications',
76 + $this->get_app_js_config()
77 + );
67 78 }
68 79
69 80 private function get_app_js_config() : array {
70 81 return [