Skip to content

Instantly share code, notes, and snippets.

@Tabrisrp
Created January 27, 2017 00:18
Show Gist options
  • Save Tabrisrp/2141404731816f67054deb44b4e2a173 to your computer and use it in GitHub Desktop.
Save Tabrisrp/2141404731816f67054deb44b4e2a173 to your computer and use it in GitHub Desktop.
<?php
/**
* Plugin Name: WP Rocket exclude dynamic CSS
* Description: Exclude dynamic CSS from static save
* Author: WP Rocket team
* License: GNU General Public License v3 or later
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/
// Basic security, prevents file from being loaded directly.
defined( 'ABSPATH' ) or die( 'Cheatin&#8217; uh?' );
add_action( 'rocket_exclude_static_dynamic_resources', 'wprocket_exclude_dynamic_files' );
function wprocket_exclude_dynamic_files( $excluded_files ) {
// Make sure to edit the line below with the correct file path
$excluded_files[] = '/wp-content/plugins/gd-star-rating/css/gdsr.css.php';
// Duplicate the above line as needed to exclude multiple files
return $excluded_files;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment