diff options
Diffstat (limited to 'documentation/examples/hooks/register/advanced.php')
-rw-r--r-- | documentation/examples/hooks/register/advanced.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/documentation/examples/hooks/register/advanced.php b/documentation/examples/hooks/register/advanced.php new file mode 100644 index 000000000..48cddd480 --- /dev/null +++ b/documentation/examples/hooks/register/advanced.php @@ -0,0 +1,23 @@ +<?php + +// the output:page hook is triggered by page_draw(). +register_plugin_hook('output', 'page', 'example_plugin_hook_handler', 600) +register_plugin_hook('output', 'page', 'example_plugin_hook_handler_2', 601); + +function example_plugin_hook_handler($event, $type, $value, $params) { + // change A to @ + $value = str_replace('A', '@', $value); + + return $value +} + +function example_plugin_hook_handler($event, $type, $value, $params) { + // change S to $ + $value = str_replace('S', '$', $value); + + return $value +} + +$content = 'This is some Sample Content.'; + +page_draw('Title', $content); |