Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-06-07 18:08:48

Andrew
Plugin Author
Registered: 2004-02-23
Posts: 730

register_callback & public-side admin plugins

I’m not clear on the purpose of public-side admin plugin functionality. Is this so that you can register callback functions that occur during the viewing of the site, such as textpattern()?

The reason I ask is I’m currently trying to compose a plugin that basically will auto_prepend itself to textpattern when a public page is loaded, so that it’s only executed once. For whatever reason, simply adding the plugin tag at the top of a page template appears to execute the plugin numerous times – but I can’t nail down what exactly is going on. Does textpattern() make several passes over the page template before outputting?

Offline

#2 2005-06-08 20:17:28

Andrew
Plugin Author
Registered: 2004-02-23
Posts: 730

Re: register_callback & public-side admin plugins

anyone?

Offline

#3 2005-06-08 23:43:51

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: register_callback & public-side admin plugins

> Does textpattern() make several passes over the page template before outputting?

Currently, yes. You can use a static or global variable to prevent a function from being run twice.

You can also execute code at plugin load time, rather than using a tag.


Alex

Offline

Board footer

Powered by FluxBB