PluginProbe
Customify / 2.10.7
Customify v2.10.7
2.10.9 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.7.1 1.3.0 1.3.1 1.4.0 1.4.1 1.4.2 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.6.0 1.6.0.1 1.6.5 1.7.0 1.7.1 All 77 releases
customify / includes / integrations / wp-rocket.php

wp-rocket.php in Customify 2.10.7, at includes/integrations/wp-rocket.php

32 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * This is logic for integrating with the WP-Rocket plugin.
4 *
5 * @link https://wp-rocket.me/
6 *
7 * @see https://pixelgrade.com
8 * @author Pixelgrade
9 * @since 2.7.1
10 */
11
12 if ( ! defined( 'ABSPATH' ) ) {
13 exit; // Exit if accessed directly
14 }
15
16 // Exclude the webfontloader script and the inline script.
17 function customify_wp_rocket_exclude_webfontloader_script( $list ) {
18 $list[] = rocket_clean_exclude_file( plugins_url( 'js/vendor/webfontloader-1-6-28.min.js', PixCustomifyPlugin()->get_file() ) );
19
20 return $list;
21 }
22 add_filter( 'rocket_exclude_js', 'customify_wp_rocket_exclude_webfontloader_script', 10, 1 );
23 add_filter( 'rocket_exclude_defer_js', 'customify_wp_rocket_exclude_webfontloader_script', 10, 1 );
24 add_filter( 'rocket_exclude_cache_busting', 'customify_wp_rocket_exclude_webfontloader_script', 10, 1 );
25
26 add_filter( 'rocket_excluded_inline_js_content', function( $inline_js ) {
27 $webfontloader_inline_script = 'customifyFontLoader = function()';
28 $inline_js[] = $webfontloader_inline_script;
29
30 return $inline_js;
31 }, 10, 1 );
32