Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I've just developed a calendar plugin.
To display a calendar in a template, I call do_shortcode(args...);.

This works fine.

But how can I call a function from my plugin that will return data?

I don't want to use include_once - I really just want to call a function E.g.

$events = calendar->getEvents(args...)
share|improve this question
    
Is there a reason why the data is not included as a shortcode parameter? –  Wyck Aug 18 '11 at 18:47
    
I thought short code only outputted data, not returning data. –  Steven Aug 18 '11 at 19:02
add comment

1 Answer

up vote 1 down vote accepted

As long as the plugin is active, the function will work perfectly fine from any template.

share|improve this answer
    
Thanks, you helped me on the right track. What I needed to do, was to create a function in my my_plugin.php that called the function I really wanted from some_other_file.php. I tried calling that function directly... and that did of course not work :) –  Steven Aug 18 '11 at 19:01
    
Excellent, glad to help. –  Pippin Aug 18 '11 at 20:51
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.