Created
October 28, 2013 19:39
-
-
Save lkraav/7203211 to your computer and use it in GitHub Desktop.
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 | |
/* | |
Plugin Name: Toolbar Theme Switcher - LESS CSS Integration | |
Plugin URI: https://github.com/sanchothefat/wp-less/issues/43 | |
Description: Fix cache refresh when switching themes | |
Author: Leho Kraav | |
Author URI: http://leho.kraav.com | |
Version: 1.0 | |
License: MIT | |
*/ | |
function tts_less_init() { | |
if ( ! class_exists( "Toolbar_Theme_Switcher" ) ) return; | |
add_filter( "wp_less_cache_path", "tts_less_cache_path" ); | |
add_filter( "wp_less_cache_url", "tts_less_cache_path" ); | |
} | |
add_action( "plugins_loaded", "tts_less_init" ); | |
function tts_less_cache_path( $path ) { | |
return sprintf( "%s-%s", $path, basename( get_stylesheet_directory() ) ); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment