Skip to content

Instantly share code, notes, and snippets.

@markonikolic985
Last active April 20, 2017 10:37
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/5450956c338f50c849e5b20821e99966 to your computer and use it in GitHub Desktop.
Save markonikolic985/5450956c338f50c849e5b20821e99966 to your computer and use it in GitHub Desktop.
<?php // Do NOT use opening tag!
add_action( 'init', '__deactivate_rocket_cdn_for_logged_in_users_2911' );
function __deactivate_rocket_cdn_for_logged_in_users_2911() {
if ( ! is_user_logged_in() ) {
return;
}
remove_filter( 'template_directory_uri' , 'rocket_cdn_file', PHP_INT_MAX );
remove_filter( 'wp_get_attachment_url' , 'rocket_cdn_file', PHP_INT_MAX );
remove_filter( 'smilies_src' , 'rocket_cdn_file', PHP_INT_MAX );
remove_filter( 'stylesheet_uri' , 'rocket_cdn_file', PHP_INT_MAX );
remove_filter( 'wp_minify_css_url' , 'rocket_cdn_file', PHP_INT_MAX );
remove_filter( 'wp_minify_js_url' , 'rocket_cdn_file', PHP_INT_MAX );
remove_filter( 'bwp_get_minify_src' , 'rocket_cdn_file', PHP_INT_MAX );
remove_filter( 'wp_get_attachment_image_src' , 'rocket_cdn_attachment_image_src', PHP_INT_MAX );
remove_filter( 'wp_calculate_image_srcset' , 'rocket_add_cdn_on_srcset', PHP_INT_MAX );
remove_filter( 'the_content' , 'rocket_cdn_images', PHP_INT_MAX );
remove_filter( 'widget_text' , 'rocket_cdn_images', PHP_INT_MAX );
remove_filter( 'rocket_buffer' , 'rocket_cdn_images', PHP_INT_MAX );
remove_filter( 'rocket_buffer' , 'rocket_cdn_inline_styles', PHP_INT_MAX );
remove_filter( 'rocket_buffer' , 'rocket_cdn_custom_files', 12 );
remove_filter( 'style_loader_src' , 'rocket_cdn_enqueue', PHP_INT_MAX - 1 );
remove_filter( 'script_loader_src' , 'rocket_cdn_enqueue', PHP_INT_MAX - 1 );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment