From cd84f9a921885b0cfa8483dc2456f7f3726d9ce6 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Mon, 27 Jul 2020 08:24:55 -0400 Subject: [PATCH] Reduce number of calls to Hook::delete when uninstalling addons/themes - Add a sweeping Hook deletion on theme uninstall (like for addons) --- src/Core/Theme.php | 2 ++ view/theme/frio/theme.php | 12 ------------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/Core/Theme.php b/src/Core/Theme.php index 3548544e9..334f31a6e 100644 --- a/src/Core/Theme.php +++ b/src/Core/Theme.php @@ -158,6 +158,8 @@ class Theme if (function_exists($func)) { $func(); } + + Hook::delete(['file' => "view/theme/$theme/theme.php"]); } $allowed_themes = Theme::getAllowedList(); diff --git a/view/theme/frio/theme.php b/view/theme/frio/theme.php index fd6927835..8b49d9c30 100644 --- a/view/theme/frio/theme.php +++ b/view/theme/frio/theme.php @@ -54,18 +54,6 @@ function frio_install() Logger::log('installed theme frio'); } -function frio_uninstall() -{ - Hook::unregister('prepare_body_final', 'view/theme/frio/theme.php', 'frio_item_photo_links'); - Hook::unregister('item_photo_menu', 'view/theme/frio/theme.php', 'frio_item_photo_menu'); - Hook::unregister('contact_photo_menu', 'view/theme/frio/theme.php', 'frio_contact_photo_menu'); - Hook::unregister('nav_info', 'view/theme/frio/theme.php', 'frio_remote_nav'); - Hook::unregister('acl_lookup_end', 'view/theme/frio/theme.php', 'frio_acl_lookup'); - Hook::unregister('display_item', 'view/theme/frio/theme.php', 'frio_display_item'); - - Logger::log('uninstalled theme frio'); -} - /** * Replace friendica photo links hook *