Skip to content

Instantly share code, notes, and snippets.

@codeiscode-dev
Last active January 24, 2018 12:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codeiscode-dev/d18f80851a73e34ac5728f80ef649716 to your computer and use it in GitHub Desktop.
Save codeiscode-dev/d18f80851a73e34ac5728f80ef649716 to your computer and use it in GitHub Desktop.
Creating your first addon
<?php
class WPEPAddOnExample extends WPEP_AddOn_Integration {
protected static $_instance;
/**
* @return WPEP_AddOn_Integration
*/
public static function instance() {
if( self::$_instance === null )
self::$_instance = new self();
return self::$_instance;
}
public function get_name() {
return "Example";
}
public function get_information() {
return array(
'version' => '1.0.0'
);
}
/**
* Runs after WPEP has been fully loaded.
* @return void
*/
public function init() {
}
<?php
/**
* Plugin Name: WP Execution Plan - Example Addon
* Plugin URI: http://developers.codeiscode.com
* Description: An Example addon.
* Version: 1.0.0
* Author: Robert
* Author URI: http://developers.codeiscode.com
*/
add_action('wpep_register_addon', 'wpep_addon_example_register');
function wpep_addon_progress_repeat_register( $addon_controller ) {
if( !class_exists('WPEPAddOnExample') )
require_once( "controller.php" );
$addon_controller->register( WPEPAddOnExample::instance() );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment