Skip to content

Instantly share code, notes, and snippets.

@smajda
Created January 16, 2012 15:51
Show Gist options
  • Save smajda/1621475 to your computer and use it in GitHub Desktop.
Save smajda/1621475 to your computer and use it in GitHub Desktop.
Add theme version option for bwp minify's cache buster
From 46e9890ead9e23600df5d081e78817e2889eddf2 Mon Sep 17 00:00:00 2001
From: Jon Smajda <jon@smajda.com>
Date: Mon, 16 Jan 2012 09:36:32 -0600
Subject: [PATCH] Add theme version as option for bwp-minify
---
.../bwp-minify/includes/class-bwp-minify.php | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/wp-content/plugins/bwp-minify/includes/class-bwp-minify.php b/wp-content/plugins/bwp-minify/includes/class-bwp-minify.php
index 276b0ce..1385940 100644
--- a/wp-content/plugins/bwp-minify/includes/class-bwp-minify.php
+++ b/wp-content/plugins/bwp-minify/includes/class-bwp-minify.php
@@ -242,6 +242,7 @@ if (!empty($page))
__('Do not append anything', 'bwp-minify') => 'none',
__('Cache folder&#8217;s last modified time', 'bwp-minify') => 'mtime',
__('Your WordPress&#8217;s current version', 'bwp-minify') => 'wpver',
+ __('Your theme&#8217;s current version', 'bwp-minify') => 'tver',
__('A custom number', 'bwp-minify') => 'custom'
)
),
@@ -409,6 +410,11 @@ if (!empty($page))
return $this->ver;
break;
+ case 'tver':
+ if ($theme = get_theme_data(TEMPLATEPATH.'/style.css'))
+ return $theme['Version'];
+ break;
+
case 'custom':
return $this->options['input_custom_buster'];
break;
--
1.7.0.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment