Skip to content

Instantly share code, notes, and snippets.

@markonikolic985
Created December 28, 2017 16:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markonikolic985/7c133ff85cd637aa02f646b5fe29705d to your computer and use it in GitHub Desktop.
Save markonikolic985/7c133ff85cd637aa02f646b5fe29705d to your computer and use it in GitHub Desktop.
/* Disable WP Rocket option 'async_css'. */
add_action( 'wp', function () {
// Stop here if WPR is not active.
if ( ! function_exists( 'get_rocket_option' ) ) {
return false;
}
// Only on front-end.
if ( ! is_admin() ) {
// Pass 0 as value to WPR option 'async_css'.
add_filter(
'pre_get_rocket_option_async_css',
'__return_zero'
);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment