Skip to content

Commit

Permalink
Fix: Remove UI hooks when uninstalling the plugin.
Browse files Browse the repository at this point in the history
It looks like I forgot to move that code when extracting the UI class.
  • Loading branch information
YahnisElsts committed Jul 14, 2018
1 parent 68f4865 commit 98ac494
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
7 changes: 7 additions & 0 deletions Puc/v4p4/Plugin/Ui.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,5 +259,12 @@ protected function formatManualCheckErrors($errors) {

return $output;
}

public function removeHooks() {
remove_filter('plugin_row_meta', array($this, 'addViewDetailsLink'), 10);
remove_filter('plugin_row_meta', array($this, 'addCheckForUpdatesLink'), 10);
remove_action('admin_init', array($this, 'handleManualCheck'));
remove_action('all_admin_notices', array($this, 'displayManualCheckResult'));
}
}
endif;
8 changes: 2 additions & 6 deletions Puc/v4p4/Plugin/UpdateChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,10 @@ protected function installHooks(){
*/
public function removeHooks() {
parent::removeHooks();
$this->extraUi->removeHooks();

remove_filter('plugins_api', array($this, 'injectInfo'), 20);

remove_filter('plugin_row_meta', array($this, 'addViewDetailsLink'), 10);
remove_filter('plugin_row_meta', array($this, 'addCheckForUpdatesLink'), 10);
remove_action('admin_init', array($this, 'handleManualCheck'));
remove_action('all_admin_notices', array($this, 'displayManualCheckResult'));


remove_filter('upgrader_post_install', array($this, 'clearCachedVersion'));
remove_action('delete_site_transient_update_plugins', array($this, 'clearCachedVersion'));
}
Expand Down

0 comments on commit 98ac494

Please sign in to comment.