]> git.mxchange.org Git - friendica.git/commitdiff
Reduce number of calls to Hook::delete when uninstalling addons/themes
authorHypolite Petovan <hypolite@mrpetovan.com>
Mon, 27 Jul 2020 12:24:55 +0000 (08:24 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Mon, 27 Jul 2020 12:24:55 +0000 (08:24 -0400)
- Add a sweeping Hook deletion on theme uninstall (like for addons)

src/Core/Theme.php
view/theme/frio/theme.php

index 3548544e95d66cfebda85bc8de4b7f7376d8be63..334f31a6e55f1f72c60f33ae72f92ba082b92c7b 100644 (file)
@@ -158,6 +158,8 @@ class Theme
                        if (function_exists($func)) {
                                $func();
                        }
+
+                       Hook::delete(['file' => "view/theme/$theme/theme.php"]);
                }
 
                $allowed_themes = Theme::getAllowedList();
index fd69278354978aa6621941800c414dda105ef5ad..8b49d9c302ec17ec74c4a46f1e9b4a6c3e3c67c8 100644 (file)
@@ -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
  *