[wp-hackers] Accessing a plugins function from theme

Christian Gundersson christian at buro2.se
Wed Jul 21 08:48:43 UTC 2010


Hi all!

 

Is there any way that I can access a function in a plugin from a theme? Say,
for example, my plugin has a function foo() that I want to access from the
theme. I assumed that the functions would be available to theme files when
they load.

 

I thought about using a filter and a meta tag (like [my_plugin_foo] and
parsing all posts for a replace) or putting foo() in my functions.php file,
but I'm kind of anal and would like to keep the plugin code in the plugin.

 

I haven't found anything regarding this on the codex or on google so any
pointers to a resource would be appreciated.

 

Thanks! (Oh, and if this is absolutely stupid, feel free to say so J)

 

//Christian



More information about the wp-hackers mailing list