From 22053e10d33c06aa0046bf05d3d420f948995a72 Mon Sep 17 00:00:00 2001 From: "jond@apple.com" Date: Fri, 4 Dec 2015 00:23:09 +0000 Subject: [PATCH] Fixed transient behavior when the cache plugin is enabled. * wp-content/themes/webkit/functions.php: * wp-content/themes/webkit/includes.php: * wp-content/themes/webkit/nightly.php: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@193387 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- Websites/webkit.org/ChangeLog | 8 ++++++++ .../wp-content/themes/webkit/functions.php | 5 +++++ .../wp-content/themes/webkit/includes.php | 23 ++++++++++------------ .../wp-content/themes/webkit/nightly.php | 4 ++-- 4 files changed, 25 insertions(+), 15 deletions(-) diff --git a/Websites/webkit.org/ChangeLog b/Websites/webkit.org/ChangeLog index 66e1032..6e1f5bc 100644 --- a/Websites/webkit.org/ChangeLog +++ b/Websites/webkit.org/ChangeLog @@ -1,5 +1,13 @@ 2015-12-03 Jonathan Davis + Fixed transient behavior when the cache plugin is enabled. + + * wp-content/themes/webkit/functions.php: + * wp-content/themes/webkit/includes.php: + * wp-content/themes/webkit/nightly.php: + +2015-12-03 Jonathan Davis + Add sub-section anchors to code style guidelines https://bugs.webkit.org/show_bug.cgi?id=151770 diff --git a/Websites/webkit.org/wp-content/themes/webkit/functions.php b/Websites/webkit.org/wp-content/themes/webkit/functions.php index 06e2630..2b86ccf 100644 --- a/Websites/webkit.org/wp-content/themes/webkit/functions.php +++ b/Websites/webkit.org/wp-content/themes/webkit/functions.php @@ -92,6 +92,11 @@ function table_of_contents_index( $content, $post_id ) { return $content; } +function is_super_cache_enabled() { + global $super_cache_enabled; + return (isset($super_cache_enabled) && true === $super_cache_enabled); +} + function tag_post_image_luminance( $post_id ) { $threshold = 128; $tags = array(); diff --git a/Websites/webkit.org/wp-content/themes/webkit/includes.php b/Websites/webkit.org/wp-content/themes/webkit/includes.php index d4d7e8f..b9aa13c 100644 --- a/Websites/webkit.org/wp-content/themes/webkit/includes.php +++ b/Websites/webkit.org/wp-content/themes/webkit/includes.php @@ -5,16 +5,13 @@ ?> - - - + ?>
-

+

-
+
-
+
- + - + endif; ?> - \ No newline at end of file + diff --git a/Websites/webkit.org/wp-content/themes/webkit/nightly.php b/Websites/webkit.org/wp-content/themes/webkit/nightly.php index 40c7b51..8279b4b 100644 --- a/Websites/webkit.org/wp-content/themes/webkit/nightly.php +++ b/Websites/webkit.org/wp-content/themes/webkit/nightly.php @@ -19,7 +19,7 @@ function get_nightly_download_details( $type = 'mac' ) { $type = $types[0]; $cachekey = 'nightly_download_' . $type; - if ( false !== ( $cached = get_transient($cachekey) ) ) + if ( is_super_cache_enabled() || false !== ( $cached = get_transient($cachekey) ) ) return json_decode($cached); $url = sprintf(WEBKIT_NIGHTLY_ARCHIVE_URL, $type); @@ -30,7 +30,7 @@ function get_nightly_download_details( $type = 'mac' ) { if ( ! empty($data) ) { $record = explode(',', $data); - set_transient($cachekey, json_encode($record), DAY_IN_SECONDS); + set_transient($cachekey, json_encode($record), HOUR_IN_SECONDS * 6); // Expire every 6 hours return $record; } -- 1.8.3.1