1
0

Added possibility for templates to register a central function

serendipity_plugin_api_event_hook() and
      serendipity_plugin_api_pre_event_hook()
This commit is contained in:
Garvin Hicking
2009-03-20 17:07:23 +00:00
parent ed67ddd917
commit 50d08ff225
3 changed files with 32 additions and 0 deletions

View File

@ -1006,6 +1006,11 @@ class serendipity_plugin_api
// skip the execution of any follow-up plugins.
$plugins = serendipity_plugin_api::get_event_plugins();
if (function_exists('serendipity_plugin_api_pre_event_hook')) {
$apifunc = 'serendipity_plugin_api_pre_event_hook';
$apifunc($event_name, $bag, $eventData, $addData);
}
if (is_array($plugins)) {
// foreach() operates on copies of values, but we want to operate on references, so we use while()
@reset($plugins);
@ -1028,6 +1033,12 @@ class serendipity_plugin_api
$plugin_data['p']->event_hook($event_name, $bag, $eventData, $addData);
}
}
if (function_exists('serendipity_plugin_api_event_hook')) {
$apifunc = 'serendipity_plugin_api_event_hook';
$apifunc($event_name, $bag, $eventData, $addData);
}
}
return true;