From a746eb751f0605101cec93e41f0a15b3bc572745 Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 3 Nov 2012 20:21:55 -0700 Subject: note about extending the hook system for application wrappers --- include/plugin.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/plugin.php b/include/plugin.php index c6d62f36e..baed2ab3b 100644 --- a/include/plugin.php +++ b/include/plugin.php @@ -150,6 +150,11 @@ function unregister_hook($hook,$file,$function) { }} +// +// It might not be obvious but themes can manually add hooks to the $a->hooks +// array in their theme_init() and use this to customise the app behaviour. +// + if(! function_exists('load_hooks')) { function load_hooks() { $a = get_app(); @@ -171,8 +176,6 @@ function call_hooks($name, &$data = null) { if((is_array($a->hooks)) && (array_key_exists($name,$a->hooks))) { foreach($a->hooks[$name] as $hook) { - // define THISPLUGIN, make life easy to plugin devs :-) - define("THISPLUGIN", $hook[0]); @include_once($hook[0]); if(function_exists($hook[1])) { $func = $hook[1]; -- cgit v1.2.3