Support » Plugins and Hacks » Hacks » Plugin interoperability

Plugin interoperability

  • What is the best practice to allow Plugin2 to call the functions of Plugin1?

    // PLUGIN_1.PHP ///////////////////
    function helloworld($data){
      // saves $data to DB
    // PLUGIN_2.PHP ////////////////////

    However, plugin_2.php might be called by WordPress first, and this would return an undefined function! I can’t use if(function_exists()) because I need to make sure the helloworld() function is called. Any solutions?

Viewing 2 replies - 1 through 2 (of 2 total)
  • use if function exists in plugin2

    in plugin 1 check if plugin2 was called already. if not call it manually.

    ighhhh. oh my god, i didnt write this, bit at least it should work 😉

    But I don’t want to have other functions redeclared twice.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Plugin interoperability’ is closed to new replies.