Page 1 of 1
Can one disable a hook?
Posted: Tue Nov 25, 2025 5:34 pm
by ArtcoInc
If a module is installed that uses a hook, can it be disabled (preferably in Admin), without actually deleting the hook (and all of the associated code)?
TIA
Malcolm
Re: Can one disable a hook?
Posted: Tue Nov 25, 2025 6:21 pm
by azpro
Yes - Possible. With Phoenix nothing is impossible! But in admin you would need Core Code adjustments - which you probably don not want.
In the hook - you can add (in the hook)
class hook_admin_siteWide_hMenu {
public $version = '1.0.0';
// DO NOT USE THIS MENU
public function listen_injectBodyStart() {
// Optie B:
return false;
}
// rest of the hook - comment out
/*
public static function sort_box_links($a, $b) {
return strcasecmp($a['title'], $b['title']);
}
*/
}
I am not sure whether it is preferable / desirable to comment out the rest of the hook. Maybe
@ecartz or
@burt can explain.
I am not sure - but I think better comment out