|
@@ -1,7 +1,7 @@ discard block |
|
|
block discarded – undo |
|
1
|
1
|
<?php |
|
2
|
|
-defined( 'ABSPATH' ) || die( 'Cheatin’ uh?' ); |
|
|
2
|
+defined('ABSPATH') || die('Cheatin’ uh?'); |
|
3
|
3
|
|
|
4
|
|
-if ( defined( 'WP_ROCKET_VERSION' ) ) : |
|
|
4
|
+if (defined('WP_ROCKET_VERSION')) : |
|
5
|
5
|
/** |
|
6
|
6
|
* Excludes Auto Load Next Post scripts from JS minification. |
|
7
|
7
|
* |
|
@@ -9,16 +9,16 @@ discard block |
|
|
block discarded – undo |
|
9
|
9
|
* @param Array $excluded_js An array of JS handles enqueued in WordPress. |
|
10
|
10
|
* @return Array $excluded_js the updated array of handles. |
|
11
|
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' ) ); |
|
|
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
|
18
|
|
|
19
|
19
|
return $excluded_js; |
|
20
|
20
|
} |
|
21
|
|
- add_filter( 'rocket_exclude_js', 'rocket_exclude_js_alnp' ); |
|
|
21
|
+ add_filter('rocket_exclude_js', 'rocket_exclude_js_alnp'); |
|
22
|
22
|
|
|
23
|
23
|
/** |
|
24
|
24
|
* Excludes Auto Load Next Post JS files from defer JS |
|
@@ -27,13 +27,13 @@ discard block |
|
|
block discarded – undo |
|
27
|
27
|
* @param Array $exclude_defer_js Array of JS filepaths to be excluded. |
|
28
|
28
|
* @return Array $exclude_defer_js the updated array of defer JS |
|
29
|
29
|
*/ |
|
30
|
|
- function rocket_exclude_defer_js_alnp( $exclude_defer_js ) { |
|
31
|
|
- $exclude_defer_js[] = rocket_clean_exclude_file( AUTO_LOAD_NEXT_POST_URL_PATH . '/assets/js/frontend/auto-load-next-post.js' ); |
|
32
|
|
- $exclude_defer_js[] = rocket_clean_exclude_file( AUTO_LOAD_NEXT_POST_URL_PATH . '/assets/js/frontend/auto-load-next-post.min.js' ); |
|
33
|
|
- $exclude_defer_js[] = rocket_clean_exclude_file( AUTO_LOAD_NEXT_POST_URL_PATH . '/assets/js/frontend/auto-load-next-post.dev.js' ); |
|
|
30
|
+ function rocket_exclude_defer_js_alnp($exclude_defer_js) { |
|
|
31
|
+ $exclude_defer_js[] = rocket_clean_exclude_file(AUTO_LOAD_NEXT_POST_URL_PATH.'/assets/js/frontend/auto-load-next-post.js'); |
|
|
32
|
+ $exclude_defer_js[] = rocket_clean_exclude_file(AUTO_LOAD_NEXT_POST_URL_PATH.'/assets/js/frontend/auto-load-next-post.min.js'); |
|
|
33
|
+ $exclude_defer_js[] = rocket_clean_exclude_file(AUTO_LOAD_NEXT_POST_URL_PATH.'/assets/js/frontend/auto-load-next-post.dev.js'); |
|
34
|
34
|
|
|
35
|
35
|
return $exclude_defer_js; |
|
36
|
36
|
} |
|
37
|
|
- add_filter( 'rocket_exclude_defer_js', 'rocket_exclude_defer_js_alnp' ); |
|
|
37
|
+ add_filter('rocket_exclude_defer_js', 'rocket_exclude_defer_js_alnp'); |
|
38
|
38
|
|
|
39
|
39
|
endif; |