# customify/trunk/includes/integrations/autoptimize.php

Customify, version trunk. 33 lines.

- Page: https://pluginprobe.com/plugins/customify/trunk/code/includes/integrations/autoptimize.php
- Raw: https://pluginprobe.com/plugins/customify/trunk/raw/includes/integrations/autoptimize.php
- Modified: 2020-05-01T16:30:32+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/customify/trunk/code/includes/integrations/autoptimize.php#L10-L20`.

```php
<?php
/**
 * This is logic for integrating with the Autoptimize plugin.
 *
 * @link https://wordpress.org/plugins/autoptimize/
 *
 * @see         https://pixelgrade.com
 * @author      Pixelgrade
 * @since       2.7.1
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly
}

// Prevent moving the webfontloader script.
add_filter( 'autoptimize_filter_js_dontmove', function( $dontmove ) {
	$dontmove[] = 'js/vendor/webfontloader';

	return $dontmove;
}, 10, 1 );

// Exclude the webfontloader script.
add_filter( 'autoptimize_filter_js_exclude', function( $excludeJS ) {
	if ( is_string( $excludeJS ) ) {
		$excludeJS .= ',js/vendor/webfontloader';
	} elseif ( is_array( $excludeJS ) ) {
		$excludeJS[] = 'js/vendor/webfontloader';
	}

	return $excludeJS;
}, 10, 1 );

```
