Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2012-01-18 15:43:55

trenc
Plugin Author
From: ⛵️, currently Göteborg, SE
Registered: 2008-02-27
Posts: 574
Website GitHub

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

#2 2012-01-18 15:52:28

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

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

#3 2012-01-19 09:40:05

trenc
Plugin Author
From: ⛵️, currently Göteborg, SE
Registered: 2008-02-27
Posts: 574
Website GitHub

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

Board footer

Powered by FluxBB