Completed
Branch master (c7ddc0)
by
unknown
02:02
created

wp-rocket.php ➔ rocket_exclude_js_alnp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 9
rs 9.9666
c 0
b 0
f 0
1
<?php
2
defined( 'ABSPATH' ) || die( 'Cheatin&#8217; uh?' );
3
4
if ( defined( 'WP_ROCKET_VERSION' ) ) :
5
	/**
6
	 * Excludes Auto Load Next Post scripts from JS minification.
7
	 *
8
	 * @since  1.5.10
9
	 * @param  Array $excluded_js An array of JS handles enqueued in WordPress.
10
	 * @return Array the updated array of handles.
11
	 */
12
	function rocket_exclude_js_alnp( $excluded_js ) {
13
		$excluded_js[] = str_replace( home_url(), '', plugins_url( '/auto-load-next-post/assets/js/frontend/auto-load-next-post.js' ) );
14
		$excluded_js[] = str_replace( home_url(), '', plugins_url( '/auto-load-next-post/assets/js/frontend/auto-load-next-post.min.js' ) );
15
		$excluded_js[] = str_replace( home_url(), '', plugins_url( '/auto-load-next-post/assets/js/frontend/auto-load-next-post.dev.js' ) );
16
		$excluded_js[] = str_replace( home_url(), '', plugins_url( '/auto-load-next-post/assets/js/libs/jquery.history.js' ) );
17
		$excluded_js[] = str_replace( home_url(), '', plugins_url( '/auto-load-next-post/assets/js/libs/scrollspy.min.js' ) );
18
19
		return $excluded_js;
20
	}
21
	add_filter( 'rocket_exclude_js', 'rocket_exclude_js_disqus' );
22
endif;
23