Comments (9)
The theme shop API would to provide the renewal link for edd_get_checkout_uri to work. Perhaps the JSON response could add that rather than us coding it.
But that's one reason I also added the "renew_url" param. If you were using a custom link structure, you could build your own link.
from edd-theme-updater.
Makes sense, thanks.
from edd-theme-updater.
I use this to provide a renewal link
/**
* Add the renewal checkout URL to the remote license check response.
*
* @param array $response The response array.
* @param array $atts The atts for EDD_Software_Licensing::remote_license_check()
* @param string $license_id The license key.
* @return array The response array.
*/
function cn_remote_license_check_response( $response, $atts, $license_id ) {
// Ensure the required functions exist; if not return $response.
if ( ! function_exists( 'edd_sl_renewals_allowed' ) &&
! function_exists( 'edd_software_licensing' ) &&
! function_exists( 'edd_get_checkout_uri' ) ) {
return $response;
}
// Ensure the license key exists; if not return $response.
if ( ! isset( $atts['key'] ) || empty( $atts['key'] ) ) {
return $response;
}
// If license renewal is not permitted; return $response.
if ( ! edd_sl_renewals_allowed() ) {
return $response;
}
// No need to add the checkout URI to the response if the license is not expired.
if ( $response['license'] !== 'expired' ) {
return $response;
}
// Bring into scope the EDD SL Class.
$licensing = edd_software_licensing();
// Get the download ID from the license key.
$download_id = $licensing->get_download_by_license( $atts['key'] );
// If the download ID was found, add the renewal URI to $response.
if ( $download_id !== FALSE ) {
$response['renewal_url'] = edd_get_checkout_uri( array( 'edd_license_key' => $atts['key'], 'download_id' => $download_id ) );
}
return $response;
}
add_filter( 'edd_remote_license_check_response', 'cn_remote_license_check_response', 10, 3 );
from edd-theme-updater.
Thanks for posting @shazahm1. Did you see if @pippinsplugins was interested in a pull request? I think this would be a nice feature.
from edd-theme-updater.
@devinsays no, I haven't ... Honestly, I thought if enough people actually wanted it, it would already be in EDD-SL.
Since EDD-SL a commercial plugin, can't really submit a pull request.
from edd-theme-updater.
I definitely would love to see a pull request :)
from edd-theme-updater.
@pippinsplugins How would I submit a PR to EDD-SL? Or, would you want this in core somehow???
from edd-theme-updater.
I've just added you to the repo.
On Fri, Oct 3, 2014 at 9:48 AM, shazahm1 [email protected] wrote:
@pippinsplugins https://github.com/pippinsplugins How would I submit a
PR to EDD-SL? Or, would you want this in core somehow???—
Reply to this email directly or view it on GitHub
#12 (comment)
.
from edd-theme-updater.
I was wondering if renewal link is now in EDD SL Plugin?
from edd-theme-updater.
Related Issues (12)
- Renew license link HOT 12
- Theme version HOT 4
- Still need to click Activate License button HOT 5
- List Site Counts (for activated license) HOT 2
- Move admin functions into a separate file HOT 2
- Works on multisite HOT 2
- Extract Strings for Filtering/Manipulation HOT 5
- Admin notice HOT 4
- Lifetime license HOT 1
- Variable inside gettext function. HOT 1
- Child Theme
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from edd-theme-updater.