I recommend to add a static method to access the plugin instance.
Example, taken from this answer:
class My_Plugin
{
private $var="foo";
protected static $instance = NULL;
public static function get_instance()
{
// create an object
NULL === self::$instance and self::$instance = new self;
return self::$instance; // return the object
}
public function __construct()
{
// set up your variables etc.
}
public function foo()
{
return $this->var;
}
}
// create an instance on wp_loaded
add_action( 'wp_loaded', array( 'My_Plugin', 'get_instance' ) );
In your theme you can access foo()
now like this:
print My_Plugin::get_instance()->foo();
do_action()
never returns something. You would need apply_filters()
:
$footer1 = apply_filters( 'finaboo_footer', 1 );