aboutsummaryrefslogtreecommitdiff
path: root/documentation/examples/hooks/register/advanced.php
blob: 48cddd4807d1823b5095d4959a1e72d45b2e0d57 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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);