[wp-hackers] Accessing a plugins function from theme

Christian Gundersson christian at buro2.se
Wed Jul 21 09:42:24 UTC 2010


Hi again,

I found the culprit. For some inexplicable reason my ftp program repeatedly
chose not to upload the file to the test host. No error or anything, just
didn't move the file.

This is a non issue, but thanks all for the help anyway.

(Stupid isn't a punishable offense is it? :))

//Christian 

-----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?

-Mike

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
get
> 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
attached
> it to any filters or hooks of any kind. In my theme file I call the
function
> 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
http://lists.automattic.com/mailman/listinfo/wp-hackers



More information about the wp-hackers mailing list