Skip to content

Instantly share code, notes, and snippets.

@andykeith
Last active July 4, 2019 14:54
Show Gist options
  • Save andykeith/3236240b0d7dec6f7ea23e1a496bca3f to your computer and use it in GitHub Desktop.
Save andykeith/3236240b0d7dec6f7ea23e1a496bca3f to your computer and use it in GitHub Desktop.
<?php
class My_WooCommerce_Plugin implements Registerable {
const ITEM_ID = 1234; // The Download ID in EDD
const NAME = 'My Cool Plugin';
const VERSION = '1.0';
const FILE = __FILE__;
private $license_controller;
public function __construct() {
$this->license_controller = new Plugin_License_Controller( new Premium_Plugin( self::get_plugin_data() ) );
}
public function register() {
$this->license_controller->register();
}
private static function get_plugin_data() {
return array(
'item_id' => self::ITEM_ID,
'name' => self::NAME,
'version' => self::VERSION,
'file' => self::FILE,
'is_woocommerce' => true,
'documentation_path' => 'kb-categories/kb-category-example/',
'settings_page_path' => 'admin.php?page=wc-settings&tab=products&section=something'
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment