Skip to content

Instantly share code, notes, and snippets.

@drrobotnik
Created December 11, 2014 19:26
Show Gist options
  • Save drrobotnik/909254ed56369cce1bd3 to your computer and use it in GitHub Desktop.
Save drrobotnik/909254ed56369cce1bd3 to your computer and use it in GitHub Desktop.
# Plugin Autoloader
do_action('plugin_autoloader');
# Plugin B
add_action( 'plugin_autoloader', 'loadStuff' );
function loadStuff(){
require_once 'class.dostuff.php';
require_once 'class.domorestuff.php';
}
# class.dostuff.php
Class DoStuff {
__construct(){
# do stuff, or not
}
private function private_stuff(){
# do private stuff
}
}
# class.domorestuff.php
Class DoMoreStuff {
__construct(){
# do stuff, or not
}
private function private_stuff(){
# do private stuff
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment