2

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...)
  • 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
3

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

  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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