Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Stuck in pluggable_ui
Hi,
I’m stuck with the pluggable_ui.
Why this will work:
register_callback('yab_extra_para', 'article_ui', 'sidehelp');
function yab_extra_para($event, $step, $data)
{
$para = '<p>New paragraph</p>';
return $para.$data;
}
but with custom_fields
as step
register_callback('yab_extra_para', 'article_ui', 'custom_fields');
function yab_extra_para($event, $step, $data)
{
$para = '<p>New paragraph</p>';
return $para.$data;
}
will double the custom fields or respectively is added to the previous data.
Does I miss something?
Digital nomad, sailing the world on a sailboat: 32fthome.com
Offline
Re: Stuck in pluggable_ui
Do you happen to have any other plugins that use the same hooking point? Only a single callback can register to single event. The default data (magic params $data
and $rs
) is not passed as a reference, but as a copy. When more than one hook is done, the resulting markup duplicates.
Offline
Re: Stuck in pluggable_ui
Do you happen to have any other plugins that use the same hooking point?
Doh! Of course.
Had written another plugin for the site, long time ago.
Thanks Jukka for pointing.
Digital nomad, sailing the world on a sailboat: 32fthome.com
Offline
Pages: 1