Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Supply some additional info in the EDD Software Licensing API update info packet, specifically: Requires WordPress Version, Compatible up to, Requires PHP Version
<?php
/*
Plugin Name: EDD Additional API Info
Plugin URI: https://gist.github.com/webaware/ccc2a77a8375da9ff02404b1fc033d05
Description: supply additional info in the EDD Software Licensing API update info packet
Version: 1
Author: WebAware
Author URI: https://shop.webaware.com.au/
*/
/*
copyright (c) 2018 WebAware Pty Ltd (email : support@webaware.com.au)
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
if (!defined('ABSPATH')) {
exit;
}
/**
* supply additional info in the update info package
* @param array $response
* @param \EDD_SL_Download $download
* @param array $readme
* @return array
*/
add_filter('edd_sl_license_readme_response', function($response, $download, $readme) {
$response['requires'] = $readme['requires']; // Requires WordPress Version
$response['tested'] = $readme['tested']; // Compatible up to
$response['requires_php'] = $readme['requires_php']; // Requires PHP Version
return $response;
}, 10, 3);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment