PluginProbe
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF / 1.7
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF v1.7
2.3.4 2.3.3 2.3.2 2.3.1 2.3.0 2.2.9 2.2.8 trunk 1.10 1.3.3 1.3.4 1.3.5 1.3.5.1 1.3.5.2 1.3.6 1.3.6.1 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.5 All 103 releases
imagify / inc / 3rd-party / wp-rocket.php

wp-rocket.php in Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF 1.7, at inc/3rd-party/wp-rocket.php

29 lines 926 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
3
4 if ( defined( 'WP_ROCKET_VERSION' ) ) :
5
6 add_action( 'imagify_assets_enqueued', 'imagify_dequeue_sweetalert_wprocket' );
7 /**
8 * Don't load Imagify CSS & JS files on WP Rocket options screen to avoid conflict with older version of SweetAlert.
9 * Since 1.6.10 they should be enqueued only if one of our notices displays here.
10 *
11 * @since 1.6.9.1
12 * @since 1.6.10 Use the new class Imagify_Assets.
13 * @author Jonathan Buttigieg
14 * @author Grégory Viguier
15 */
16 function imagify_dequeue_sweetalert_wprocket() {
17 if ( ! defined( 'WP_ROCKET_PLUGIN_SLUG' ) ) {
18 return;
19 }
20
21 if ( ! imagify_is_screen( 'settings_page_' . WP_ROCKET_PLUGIN_SLUG ) && ! imagify_is_screen( 'settings_page_' . WP_ROCKET_PLUGIN_SLUG . '-network' ) ) {
22 return;
23 }
24
25 Imagify_Assets::get_instance()->dequeue_script( array( 'sweetalert-core', 'sweetalert', 'notices' ) );
26 }
27
28 endif;
29