If your aren’t very familiar with PHP, use simple actions and filters in your theme, and register callbacks for those in your plugin class.
A basic example
Plugin
class Plugin_Class
{
public function __construct()
{
$this->register_callbacks();
}
protected function register_callbacks()
{
add_filter( 'theme_foo', array( $this, 'foo' ) );
add_action( 'theme_bar', array( $this, 'bar' ) );
}
public function foo()
{
return 'foo';
}
public function bar()
{
returnprint 'bar';
}
}
Theme
$foo = apply_filters( 'theme_foo', FALSE );
if ( $foo )
echo "foo is $foo";
do_action( 'theme_bar' ); // prints 'bar'