aboutsummaryrefslogtreecommitdiff
path: root/documentation/examples/hooks/register/advanced.php
blob: a21a2e232fc264b12abf2d53e19344ec6296efd8 (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);