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 have created two WordPress plugins. If both plugins are installed, some beneficial cooperation could take place between the two.

So my question: what is the best way to get them to work together? How do I detect a certain plugin is enabled? How do I transmit information? I suppose I could use globals, but is there a better way?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

your question depends a lot on what you want to do ..

But in general , when a plugin is loaded or executed, the functions are being "registered" in PHP server and are available for all to use (depending of course HOW you write them) ...

So for example, to detect if a plugin is enabled or installed, the other plugin could have

if (function_exists('NameOfFunctionFromPlugin1')

there is also a wordpress function to check plugin activation

<?php is_plugin_active($plugin) ?>

http://codex.wordpress.org/Function_Reference/is_plugin_active

as for "transmitting Info" : Because the functions are available, you could use them. so for example, a value that is returned from a certain function in one plugin, can be evoked by the other , calling this function , and getting the value returned for use .

share|improve this answer
    
Of course, I was trying to make this far too complicated. Thanks for the answer –  Peter Jan 6 '12 at 13:22

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.