Last active
January 24, 2018 12:20
-
-
Save codeiscode-dev/d18f80851a73e34ac5728f80ef649716 to your computer and use it in GitHub Desktop.
Creating your first addon
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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() { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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