[wp-hackers] Accessing a plugins function from theme

Christian Gundersson christian at buro2.se
Wed Jul 21 09:30:06 UTC 2010

The plugin is activated and working for all other intents and purposes, and
it's not wrapped in a class either.

As a side thought, if the function would produce a fatal error in itself
when the plugin file is parsed, would that keep the definition from being
read, or would it be still be "callable" and then generate an error?


-----Ursprungligt meddelande-----
Från: wp-hackers-bounces at lists.automattic.com
[mailto:wp-hackers-bounces at lists.automattic.com] För Mike Schinkel
Skickat: den 21 juli 2010 11:24
Till: wp-hackers at lists.automattic.com
Ämne: Re: [wp-hackers] Accessing a plugins function from theme

Obvious question, but; I assume you've activated the plugin?
If yes, your function isn't wrapped in a class, is it?


On Jul 21, 2010, at 5:21 AM, Christian Gundersson wrote:

> Hi,
> Thanks for the replies. I see now that I probably should have clarified a
> bit more :)
> I have done this but my function isn't getting called like it should. I
> a "call to undefined function" error when I access the theme file.
> I have declared a function foo() in my plugins base file. I haven't
> it to any filters or hooks of any kind. In my theme file I call the
> simply by 
> if ( function_exists ( 'foo' ) )
> foo();
> Have I missed anything, or should that "just work"?
> Thanks again!
> //Christian

wp-hackers mailing list
wp-hackers at lists.automattic.com

More information about the wp-hackers mailing list