Hooks Definitions are confusing to me

Fragment of a discussion from Project:Support desk
Jump to: navigation, search

Basically the IP who asks the question is right: The definition inside the "$wgHooks['ParserFirstCallInit'][] = " line must fit to the function name. In the example, this should also be the case, but is not.

Either the second line should be

$wgHooks['ParserFirstCallInit'][] = 'fnMyHook';

or the hook function should be

class MyExtensionHooks {
 function someExample() {
 // ...your code...
 return true;
 }
}
88.130.124.11820:38, 29 April 2012