Home / eCommerce / Sample WordPress plugin Software Licensing API implementation
Duplicate Snippet

Embed Snippet on Your Site

Sample WordPress plugin Software Licensing API implementation

Sample EDD Software Licensing API integration: easily set your WordPress plugin up to work with the EDD SL SDK, to add automatic update and licensing checks.

Code Preview
php
<?php
/**
 * Plugin Name: AAA Sample Plugin
 * Plugin URI: https://easydigitaldownloads.com
 * Description: Illustrates how to include an updater in your plugin for EDD Software Licensing.
 * Author: Sandhills Development, LLC
 * Author URI: https://easydigitaldownloads.com
 * Version: 1.0.0
 * License: GNU General Public License v2.0 or later
 * License URI: http://www.gnu.org/licenses/gpl-2.0.html
 */
add_action(
	'edd_sl_sdk_registry',
	function ( $init ) {
		$init->register(
			array(
				'id'      => 'edd-sample-plugin', // The plugin slug.
				'url'     => 'https://edd.local', // The URL of the site with EDD installed.
				'item_id' => 83, // The download ID of the product in Easy Digital Downloads.
				'version' => '1.0.0', // The version of the product.
				'file'    => __FILE__, // The path to the main plugin file.
			)
		);
	}
);
if ( file_exists( __DIR__ . '/vendor/easy-digital-downloads/edd-sl-sdk/edd-sl-sdk.php' ) ) {
	require_once __DIR__ . '/vendor/easy-digital-downloads/edd-sl-sdk/edd-sl-sdk.php';
}

Comments

Add a Comment