GetSimple Support Forum

Full Version: add_filter??
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is there anyone who can explain to me, how to create a filter.
I mean, i would create:
I write (% test %) in my content, and i see my plugin test in the place where i wrote...

Sorry for my english.. if someone can explain to me in italian i'll be very happy.. but i'll appreciate any kind of help.

Smile
if you want to create a plugin, read here: http://get-simple.info/wiki/plugins:creation

if you want to create a component and add that to your content, read here: http://get-simple.info/wiki/components?s[]=component

that's in the WIKI
Connie Wrote:if you want to create a plugin, read here: http://get-simple.info/wiki/plugins:creation

if you want to create a component and add that to your content, read here: http://get-simple.info/wiki/components?s[]=component

that's in the WIKI

Thanks for the answer. I'll try to be more clear.
For example, the mp3 plugin.
I write (% mysong.mp3 %) in the page where i want to insert the player.

I would do the same thing with my plugin.
eru321 Wrote:Thanks for the answer. I'll try to be more clear.
For example, the mp3 plugin.
I write (% mysong.mp3 %) in the page where i want to insert the player.

I would do the same thing with my plugin.

Use add_filter to specify a function in your plugin as content filter.
In this function use a regular expression to find the (% ... %), which belongs to your plugin and replace it with the desired text.
mvlcek Wrote:
eru321 Wrote:Thanks for the answer. I'll try to be more clear.
For example, the mp3 plugin.
I write (% mysong.mp3 %) in the page where i want to insert the player.

I would do the same thing with my plugin.

Use add_filter to specify a function in your plugin as content filter.
In this function use a regular expression to find the (% ... %), which belongs to your plugin and replace it with the desired text.

THANKSSSSSSSSS A LOT!
It Works.
Really really thanks.