From 80a644e329c809fb89c923475ba19d4da51f2220 Mon Sep 17 00:00:00 2001 From: Yahnis Elsts Date: Sat, 20 Oct 2012 15:19:47 +0000 Subject: [PATCH] Store update state in a site option, instead of a normal, per-site field. WordPress itself stores updates in a site transient, and there's really no point in maintaining separate update states for each site in a network. --- plugin-update-checker.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugin-update-checker.php b/plugin-update-checker.php index 7f924eb..1df03bf 100644 --- a/plugin-update-checker.php +++ b/plugin-update-checker.php @@ -288,7 +288,7 @@ class PluginUpdateChecker { * @return StdClass|null */ private function getUpdateState() { - $state = get_option($this->optionName); + $state = get_site_option($this->optionName); if ( !empty($state) && isset($state->update) && !($state->update instanceof PluginUpdate) ){ $state->update = PluginUpdate::fromObject($state->update); } @@ -307,7 +307,7 @@ class PluginUpdateChecker { $update = $state->update; /** @var PluginUpdate $update */ $state->update = $update->toStdClass(); } - update_option($this->optionName, $state); + update_site_option($this->optionName, $state); } /** @@ -317,7 +317,7 @@ class PluginUpdateChecker { * clear the update cache. */ public function resetUpdateState() { - delete_option($this->optionName); + delete_site_option($this->optionName); } /**