Last active
December 31, 2018 06:58
-
-
Save webaware/ccc2a77a8375da9ff02404b1fc033d05 to your computer and use it in GitHub Desktop.
Supply some additional info in the EDD Software Licensing API update info packet, specifically: Requires WordPress Version, Compatible up to, Requires PHP Version
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 | |
/* | |
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