Skip to content

Instantly share code, notes, and snippets.

@glueckpress
Created November 29, 2017 18:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save glueckpress/b12903d030c58ac6c9587c7a91454e54 to your computer and use it in GitHub Desktop.
Save glueckpress/b12903d030c58ac6c9587c7a91454e54 to your computer and use it in GitHub Desktop.
[WordPress][WP Rocket] Print values of minify options as HTML comments to wp_footer().
<?php
/**
* Quick and dirty addition to:
* https://github.com/wp-media/wp-rocket-helpers/tree/master/wp-rocket-debug-helper
*/
add_action( 'wp_footer', function () {
if ( ! function_exists( 'get_rocket_option' ) ) {
return;
}
printf( '<!-- Minify CSS: %s -->', var_export( get_rocket_option( 'minify_css' ), true ) ) . PHP_EOL;
printf( '<!-- Minify JS: %s -->', var_export( get_rocket_option( 'minify_js' ), true ) ) . PHP_EOL;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment