Instantiate class to be available to all plugin functions
Ryan McCue had a nice idea for his plugin Hopper: add a callback for a custom filter to return the current instance. Sample code for the plugin: class Plugin_Class { public function __construct() { add_filter( ‘get_plugin_class’, array ( $this, ‘provide_instance’ ) ); } function provide_instance() { return $this; } } In a theme or a … Read more