PHP code example of alledia / edd-sl-plugin-updater
1. Go to this page and download the library: Download alledia/edd-sl-plugin-updater library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
alledia / edd-sl-plugin-updater example snippets
add_action('admin_init', 'init_updater');
function init_updater()
{
// The site for the EDD store.
$apiUrl = 'https://site-with-edd.com';
$pluginFile = 'your-plugin/your-plugin.php';
// The version of your add-on/plugin.
$currentVersion = '1.0.5';
// ID for the add-on/plugin on EDD.
$addonEddId = '3252';
$author = 'Your Name';
// Initialize the library.
$updater = new Alledia\EDD_SL_Plugin_Updater(
$apiUrl,
$pluginFile,
[
'version' => $currentVersion,
'license' => get_option('upstream_frontend_edit_license_key'),
'item_id' => $addonEddId,
'author' => $author,
'beta' => false,
]
);
}