Add a resetUpdateState() method for clearing update cache, last check timestamp and last checked version.
This commit is contained in:
parent
9a9c6c2b53
commit
aceb9e62a5
|
|
@ -310,6 +310,16 @@ class PluginUpdateChecker {
|
|||
update_option($this->optionName, $state);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset update checker state - i.e. last check time, cached update data and so on.
|
||||
*
|
||||
* Call this when your plugin is being uninstalled, or if you want to
|
||||
* clear the update cache.
|
||||
*/
|
||||
public function resetUpdateState() {
|
||||
delete_option($this->optionName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Intercept plugins_api() calls that request information about our plugin and
|
||||
* use the configured API endpoint to satisfy them.
|
||||
|
|
@ -432,6 +442,7 @@ class PluginUpdateChecker {
|
|||
'<div class="updated"><p>%s</p></div>',
|
||||
apply_filters('puc_manual_check_message-' . $this->slug, $message, $update)
|
||||
);
|
||||
//todo: the update doesn't show up right away, why?
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue