From 25bbdbf272ed0d7b4a4b23bcd83df781b99d1599 Mon Sep 17 00:00:00 2001
From: moha <moha@844d07d2-d7f9-4290-a55f-1295d075e86f>
Date: Fri, 13 Jan 2012 09:14:16 +0000
Subject: [PATCH] Lets update blog option keys when update_option is called

---
 wp-includes/ms-blogs.php |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/wp-includes/ms-blogs.php b/wp-includes/ms-blogs.php
index 1c483e1..f97262b 100644
--- a/wp-includes/ms-blogs.php
+++ b/wp-includes/ms-blogs.php
@@ -308,6 +308,26 @@ function update_blog_details( $blog_id, $details = array() ) {
 }
 
 /**
+ * Update site options and refresh blog details when options are updated using
+ * update_options();
+ *
+ * @since 3.3.1
+ *
+ * @param string $id The option key
+ * @param mixed $old_value The old option value
+ * @param mixed $newvalue The new option value
+ */
+function update_any_blog_option( $option, $old_value, $new_value ) {
+        global $wpdb;
+
+        wp_cache_set($wpdb->blogid . '-' . $option . '-blog_option', $new_value, 'site-options');
+        if (in_array($option, array('blogname','siteurl','post_count'))) {
+                refresh_blog_details( $wpdb->blogid );
+        }
+}
+add_action('updated_option', 'update_any_blog_option', 10, 3);
+
+/**
  * Retrieve option value based on setting name and blog_id.
  *
  * If the option does not exist or does not have a value, then the return value
-- 
1.7.5.4

