Created
July 23, 2014 21:38
-
-
Save atwellpub/ad7fb6438d84ceae0acb to your computer and use it in GitHub Desktop.
How to add license handling and extension updating to your Inbound Now extensio
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 | |
/** Define constants somewhere in plugin */ | |
define('EXTENSION_CURRENT_VERSION', '1.0.5' ); | |
define('EXTENSION_LABEL' , 'Extension Integration' ); | |
define('EXTENSION_SLUG' , plugin_basename( dirname(__FILE__) ) ); | |
define('EXTENSION_FILE' , __FILE__ ); | |
define('EXTENSION_REMOTE_ITEM_NAME' , 'extension-integration' ); | |
define('EXTENSION_URLPATH', plugins_url( ' ', __FILE__ ) ); | |
define('EXTENSION_PATH', WP_PLUGIN_DIR.'/'.plugin_basename( dirname(__FILE__) ).'/' ); | |
/** Setup Automatic Updating & Licensing */ | |
add_action('admin_init', 'license_setup' ); | |
/** | |
* Setups Software Update & Licenseing API | |
*/ | |
function license_setup() { | |
/*PREPARE THIS EXTENSION FOR LICESNING*/ | |
if ( class_exists( 'Inbound_License' ) ) { | |
$license = new Inbound_License( EXTENSION_FILE , EXTENSION_LABEL , EXTENSION_SLUG , EXTENSION_CURRENT_VERSION , EXTENSION_REMOTE_ITEM_NAME ) ; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment