2015-02-04, 08:49 PM
I have ran into an issue, and I haven't been able to resolve it myself. A quick search shows code similar to my own, but for some reason it just doesn't want to work for me. It's dead simple too.
I have a function that hooks into postbit. I have tried making this a custom variable, and also tried making it a key within the array. None of it wants to work.
This is my code:
The in the template I'm doing {$post['test']}, but it just doesn't output anything.
I have tried making it a custom variable $test in the add_to_postbit function, and also global'ing it inside that function, but it doesn't work either with the output {$test}.
Any ideas as to what I'm doing wrong?
I have a function that hooks into postbit. I have tried making this a custom variable, and also tried making it a key within the array. None of it wants to work.
This is my code:
$plugins->add_hook('postbit', 'add_to_postbit');
function add_to_postbit(&$post)
{
$post['test'] = 'This is a TEST variable.';
}
The in the template I'm doing {$post['test']}, but it just doesn't output anything.
I have tried making it a custom variable $test in the add_to_postbit function, and also global'ing it inside that function, but it doesn't work either with the output {$test}.
Any ideas as to what I'm doing wrong?