Created
July 23, 2012 21:21
-
-
Save leewillis77/3166309 to your computer and use it in GitHub Desktop.
Changes to WFX theme framework
This file contains hidden or 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
--- wf-display-functions.php.orig 2012-07-23 22:13:49.026990879 +0100 | |
+++ wf-display-functions.php 2012-07-23 22:17:44.358981036 +0100 | |
@@ -1848,20 +1848,22 @@ | |
// Backpat - depreciated function get_current_theme() in WordPress 3.4 | |
$theme_name = preg_replace('/[^a-zA-Z0-9]/','_', ( WF_WORDPRESS_VERSION < 3.4 ) ? get_current_theme() : wp_get_theme()->Name); | |
+ /* Risk of the transient key ooverflowing the allowed size - WordPress has a bug where key's > 32 chars | |
+ * will appear to have been set, but won't be retrievable */ | |
$transient_key = empty($transient_key) ? $theme_name.'_cache_'.$part : $transient_key; | |
// Cache flush control | |
$flush_all = false; | |
$flush_this = false; | |
- if( $flushable == 'Y' && is_user_logged_in() ) { | |
- global $current_user; | |
+ if( $flushable == 'Y' ) { | |
if ( current_user_can('edit_theme_options') ) { | |
$flush_all = ( isset($_GET['flushcache_all']) && $_GET['flushcache_all'] == 1 ) ? true : false; | |
$flush_this = ( isset($_GET['flushcache_'.$part.'']) && $_GET['flushcache_'.$part.''] == 1 ) ? true : false; | |
} | |
} | |
- $cached_data = ( $flush_all != true || $flush_all != true ) ? get_transient($transient_key) : false; | |
+ /* Not sure about the following change? */ | |
+ $cached_data = ( $flush_all != true || $flush_this != true ) ? get_transient($transient_key) : false; | |
$allowed_tags = ($sanitise_in == 'html' || $sanitise_out == 'html') ? $wfx_data_manage->allowed_tags('') : ''; | |
// Load cache with data |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment