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