Last active
March 18, 2022 06:12
-
-
Save adamsilverstein/9933f3efb479544e6f8a8f026ddf58ca to your computer and use it in GitHub Desktop.
Improve compatibility between Site Kit and WP Rocket
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* WP Rocket compatibility for Site Kit. | |
* | |
* @wordpress-plugin | |
* Plugin Name: SiteKit WP Rocket Compatibility | |
* Description: Improve compatibility between Site Kit and WP Rocket. | |
* Plugin URI: | |
* Version: 1.0.0 | |
* Author: Adam Silverstein, Google | |
* License: Apache License 2.0 | |
* License URI: https://www.apache.org/licenses/LICENSE-2.0 | |
*/ | |
add_filter( | |
'rocket_exclude_js', | |
function( $js_files ) { | |
$js_files = array_push( 'google-site-kit/dist/assets/js/.*\.js' ); | |
return array( $js_files ); | |
} | |
); |
👍
Can we update it to exclude everything in google-site-kit/dist/
? (styles too)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
s/appay_push/array_push/