PluginProbe
Elementor Website Builder – more than just a page builder / 3.24.8
Elementor Website Builder – more than just a page builder v3.24.8
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 | core/page-assets/loader.php +30 -4 4.2.0-dev23.24.8 View file →
@@ -7,9 +7,9 @@
7 7 use Elementor\Control_Exit_Animation;
8 8 use Elementor\Control_Hover_Animation;
9 9
10 10 if ( ! defined( 'ABSPATH' ) ) {
11 - exit; // Exit if accessed directly.
11 + exit; // Exit if accessed directly
12 12 }
13 13
14 14 /**
15 15 * Elementor assets loader.
@@ -35,8 +35,14 @@
35 35 }
36 36
37 37 private function init_styles(): array {
38 38 $styles = [
39 + // TODO: Remove the 'e-animations' registration in v3.26.0 [ED-15471].
40 + 'e-animations' => [
41 + 'src' => $this->get_css_assets_url( 'animations', 'assets/lib/animations/', true ),
42 + 'version' => ELEMENTOR_VERSION,
43 + 'dependencies' => [],
44 + ],
39 45 'e-shapes' => [
40 46 'src' => $this->get_css_assets_url( 'shapes', 'assets/css/conditionals/' ),
41 47 'version' => ELEMENTOR_VERSION,
42 48 'dependencies' => [],
@@ -46,10 +52,10 @@
46 52 'version' => ELEMENTOR_VERSION,
47 53 'dependencies' => [ 'swiper' ],
48 54 ],
49 55 'swiper' => [
50 - 'src' => $this->get_css_assets_url( 'swiper', 'assets/lib/swiper/v8/css/' ),
51 - 'version' => '8.4.5',
56 + 'src' => $this->get_css_assets_url( 'swiper', $this->getSwiperPath() ),
57 + 'version' => $this->getSwiperVersion(),
52 58 'dependencies' => [],
53 59 ],
54 60 ];
55 61
@@ -55,8 +61,16 @@
55 61
56 62 return array_merge( $styles, $this->get_animation_styles() );
57 63 }
58 64
65 + private function getSwiperPath(): string {
66 + return Plugin::$instance->experiments->is_feature_active( 'e_swiper_latest' ) ? 'assets/lib/swiper/v8/css/' : 'assets/lib/swiper/css/';
67 + }
68 +
69 + private function getSwiperVersion(): string {
70 + return Plugin::$instance->experiments->is_feature_active( 'e_swiper_latest' ) ? '8.4.5' : '5.3.6';
71 + }
72 +
59 73 private function get_animations(): array {
60 74 $grouped_animations = Control_Animation::get_default_animations();
61 75 $grouped_animations['hover'] = Control_Hover_Animation::get_default_animations();
62 76 $exit_animations = Control_Exit_Animation::get_default_animations();
@@ -99,9 +113,9 @@
99 113 return $this->assets;
100 114 }
101 115
102 116 /**
103 - * @param array $assets_data {
117 + * @param array $assets {
104 118 * @type array 'styles'
105 119 * @type array 'scripts'
106 120 * }
107 121 */
@@ -153,13 +167,25 @@
153 167 if ( ! empty( $asset_data['enabled'] ) || $is_preview_mode ) {
154 168 if ( 'scripts' === $assets_type ) {
155 169 wp_enqueue_script( $asset_name, $asset_data['src'], $asset_data['dependencies'], $asset_data['version'], true );
156 170 } else {
171 + // TODO: Remove the 'e-animations' registration in v3.26.0 [ED-15471].
172 + if ( $this->skip_animations_style( $asset_name ) ) {
173 + continue;
174 + }
175 +
157 176 wp_enqueue_style( $asset_name, $asset_data['src'], $asset_data['dependencies'], $asset_data['version'] );
158 177 }
159 178 }
160 179 }
161 180 }
181 + }
182 +
183 + // TODO: Remove the 'e-animations' registration in v3.26.0 [ED-15471].
184 + private function skip_animations_style( $asset_name ): bool {
185 + $is_preview = Plugin::$instance->preview->is_preview_mode();
186 +
187 + return $is_preview && 'e-animations' === $asset_name;
162 188 }
163 189
164 190 private function register_assets(): void {
165 191 $assets = $this->get_assets();