From 4963d5f94577feada290ff31a1ecb393228967a3 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Sat, 11 Jun 2011 03:16:42 +0000 Subject: [PATCH] Key the Dashboard widget cache off the Widget ID & clear cache upon options changing. Props ocean90. Fixes #16927 git-svn-id: https://develop.svn.wordpress.org/trunk@18264 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/dashboard.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-admin/includes/dashboard.php b/wp-admin/includes/dashboard.php index 63f0fe207a..9547f8f92c 100644 --- a/wp-admin/includes/dashboard.php +++ b/wp-admin/includes/dashboard.php @@ -1042,7 +1042,7 @@ function wp_dashboard_cached_rss_widget( $widget_id, $callback, $check_urls = ar $check_urls = array( $widgets[$widget_id]['url'] ); } - $cache_key = 'dash_' . md5( $callback . implode(',', $check_urls) ); + $cache_key = 'dash_' . $widget_id; if ( false !== ( $output = get_transient( $cache_key ) ) ) { echo $output; return true; @@ -1118,6 +1118,8 @@ function wp_dashboard_rss_control( $widget_id, $form_inputs = array() ) { } } update_option( 'dashboard_widget_options', $widget_options ); + $cache_key = 'dash_' . $widget_id; + delete_transient( $cache_key ); } wp_widget_rss_form( $widget_options[$widget_id], $form_inputs );