Guest User

Untitled

a guest
Oct 17th, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. class PluginA {
  2. public function func_a() {
  3. // do stuff
  4. }
  5. }
  6.  
  7. class PluginB {
  8. function functB() {
  9. if (class_exists('PluginA')) {
  10. //do stuff that depends of PluginA
  11. }
  12. }
  13. }
  14.  
  15. add_action('plugins_loaded', 'call_plugin_a_using_plugin_b');
  16. function call_plugin_a_using_plugin_b() {
  17. PluginB::functB();
  18. }
  19.  
  20. function from_plugin_alpha( some_thing ) {
  21. // do stuff
  22. }
  23.  
  24. function from_plugin_bravo() {
  25. if ( !function_exists( 'from_plugin_alpha' ) ) {
  26. return;
  27. }
  28. from_plugin_alpha( some_thing );
  29. }
Add Comment
Please, Sign In to add comment