My favorites | Sign in
Project Logo
             
Search
for
Updated Aug 23, 2007 by tslocum
PostingHook  
Description of the posting hook

This hook processes a post once the internal script is through processing it.

Initialization Example

/* Module initialization */
function yourmodule_init() {
	global $hooks;
	
	$hooks['posting'][] = 'yourmodule';
}

Processing Example

/* Posting hook processing */
function yourmodule_process_posting($post) {
	$post['message'] = str_replace('hamburger', 'hotdog', $post['message']);
	
	return $post;
}

Arguments

1 argument:

Array $post

Return

The process function must return the modified $post variable, which will be passed to subsequent modules using this hook, and then finally inserted into the database.


Sign in to add a comment
Hosted by Google Code