PluginProbe
Elementor Website Builder – more than just a page builder / 3.13.0-beta1
Elementor Website Builder – more than just a page builder v3.13.0-beta1
4.3.4 4.3.3 4.3.2 4.3.1 4.3.0 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 All 457 releases
← All changes | modules/announcements/module.php +31 -16 4.2.0-dev2 → 3.13.0-beta1 View file →
@@ -41,17 +41,13 @@
41 41 private function enqueue_scripts() {
42 42 wp_enqueue_script(
43 43 'announcements-app',
44 44 $this->get_js_assets_url( 'announcements-app' ),
45 - [
46 - 'wp-i18n',
47 - ],
45 + [],
48 46 ELEMENTOR_VERSION,
49 47 true
50 48 );
51 49
52 - wp_set_script_translations( 'announcements-app', 'elementor' );
53 -
54 50 $this->print_config( 'announcements-app' );
55 51 }
56 52
57 53 /**
@@ -64,9 +60,9 @@
64 60 $additional_settings = [];
65 61
66 62 foreach ( $active_announcements as $announcement ) {
67 63 $additional_settings[] = $announcement->get_prepared_data();
68 - // @TODO - replace with ajax request from the front after actually triggered
64 + //@TODO - replace with ajax request from the front after actually triggered
69 65 $announcement->after_triggered();
70 66 }
71 67
72 68 return [
@@ -91,12 +87,36 @@
91 87 *
92 88 * @return array[]
93 89 */
94 90 private function get_raw_announcements(): array {
95 - $raw_announcements = [];
96 -
97 - // DO NOT USE THIS FILTER
98 - return apply_filters( 'elementor/announcements/raw_announcements', $raw_announcements );
91 + return [
92 + [
93 + 'title' => 'Activate Containers for Brilliant Layouts',
94 + 'description' => 'Take advantage of the full power of Containers in Elementor to create slick, pixel-perfect, responsive layouts, plus improve the performance of your website. Follow these steps: <strong>Switch Flexbox Container to ‘Active’ and Save.</strong>',
95 + 'media' => [
96 + 'type' => 'image',
97 + 'src' => ELEMENTOR_ASSETS_URL . 'images/announcement.png',
98 + ],
99 + 'cta' => [
100 + [
101 + 'label' => 'Activate Containers',
102 + 'variant' => 'primary',
103 + 'target' => '_blank',
104 + 'url' => ElementorSettings::get_url() . '#tab-experiments',
105 + ],
106 + [
107 + 'label' => 'Try It First',
108 + 'target' => '_blank',
109 + 'url' => 'https://go.elementor.com/whats-new-popup/',
110 + ],
111 + ],
112 + 'triggers' => [
113 + [
114 + 'action' => 'isFlexContainerInactive',
115 + ],
116 + ],
117 + ],
118 + ];
99 119 }
100 120
101 121 /**
102 122 * Retrieve all announcement objects.
@@ -128,17 +148,12 @@
128 148 return $active_announcements;
129 149 }
130 150
131 151 public function __construct() {
132 - parent::__construct();
133 -
134 - add_action( 'elementor/init', [ $this, 'on_elementor_init' ] );
135 - }
136 -
137 - public function on_elementor_init() {
138 152 if ( empty( $this->get_active_announcements() ) ) {
139 153 return;
140 154 }
155 + parent::__construct();
141 156
142 157 add_action( 'elementor/editor/footer', function () {
143 158 $this->render_app_wrapper();
144 159 } );