Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
callback_event example
Hi.
i’m making a new plugin and i want use a callback_event function.
At the end of body, into admin side, I need insert some text by different plugin.
At the moment i made this, and it not work. Why?
if(@txpinterface == 'admin') {
// Insert call of test
register_callback('mck_test', 'admin_side', 'body_end');
}
function mck_test($event, $step){
echo n.'this is a test: my text is:'.
'.callback_event('mck_test.show').'; what did you think?'.n;
}
By another plugin I want insert some text:
if (@txpinterface == 'admin') {
register_callback('mck_insert','mck_test','show');
}
function mck_insert($event, $step){
echo 'This is an Italian Test!!';
}
Someone can help me?
Offline
Re: callback_event example
You are hooking to different event than the one which you are invoking mck_test(). The one you have created is mck_test.show
but you are hooking to mck_test > show
— latter is defined with a separate event and step. Either put the show to the $step argument in the callback_event(), or merge the $event and $step in register_callback().
Last edited by Gocom (2013-02-27 15:08:26)
Offline
Re: callback_event example
Thanks Jukka….. I understand.
Offline
Pages: 1