PluginProbe
Customify / 2.10.0
Customify v2.10.0
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 / autoptimize.php

autoptimize.php in Customify 2.10.0, at includes/integrations/autoptimize.php

33 lines 787 B
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 Autoptimize plugin.
4 *
5 * @link https://wordpress.org/plugins/autoptimize/
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 // Prevent moving the webfontloader script.
17 add_filter( 'autoptimize_filter_js_dontmove', function( $dontmove ) {
18 $dontmove[] = 'js/vendor/webfontloader';
19
20 return $dontmove;
21 }, 10, 1 );
22
23 // Exclude the webfontloader script.
24 add_filter( 'autoptimize_filter_js_exclude', function( $excludeJS ) {
25 if ( is_string( $excludeJS ) ) {
26 $excludeJS .= ',js/vendor/webfontloader';
27 } elseif ( is_array( $excludeJS ) ) {
28 $excludeJS[] = 'js/vendor/webfontloader';
29 }
30
31 return $excludeJS;
32 }, 10, 1 );
33