Can I run custom hooks from a plugin?
#3
(2012-10-02, 03:46 PM)euantor Wrote: Try something like this:

$plugins->run_hooks('exersice_start', $data);

Then hook into it with

$plugins->add_hook("exercise_start", "custom_hook_test_code");
function custom_hook_test_code(&$data) {
    $data = str_replace("<br />", "<br /><p>Caught my hook!</p>", $data);
}

That should work Smile

Thanks! That does work.

It was a spelling error; I mis-spelled 'exercise' in the run_hooks call Blush
-TOA
Ordo Ab Chao
"Insanity: doing the same thing over again and expecting different results." - Einstein
Reply


Messages In This Thread
Can I run custom hooks from a plugin? - by TOA - 2012-10-02, 03:25 PM
RE: Can I run custom hooks from a plugin? - by TOA - 2012-10-02, 04:47 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)